Author Topic: Delete Locked Files  (Read 5254 times)

Offline Jack W

  • TS Addict
  • *****
  • Posts: 2597
    • View Profile
Delete Locked Files
« on: July 02, 2006, 07:08:25 PM »
I've got a new phenomenon  since updating to Tiger 10.4.6+.

When I try to move a locked file to the trash, or delete, Tiger won't let me do it.

In Jag, I could move to Trash, and then Option-delete.

Is this just me? Or is this a new "Feature" introduced in Tiger?

- Jack
Good to be Here.

My Macs: 2010 27" alum iMac 2.8GHz, Snow Leopard 10.6.8/Mavericks 10.9.5, 4GB SDRAM (Workhorse),
13” Late 2010 MacBook Pro 2.4GHz, 10.6.8, 2GB SDRAM,
(2) External HD - Firewire/USB Macally Enclosures  with 1TB Hitachi Drives,
Time Machine external drive - ditto above - 1/2 TimeMac

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Delete Locked Files
« Reply #1 on: July 02, 2006, 07:47:26 PM »
Not sure how you even got a locked file into the Trash! I locked a useless file on the Desktop and I couldn't drag it into the Trash! I was able to lock a copy of the unlocked file I put in the Trash, however.

I could empty using control-click the file and selecting "Empty". However, I could also use command-shift-delete!

Since I use iCan, I also could empty a locked file by option-clicking the icon and selecting the plain "Empty" choice. There is also a "Smart Empty" selection that I have used when the OS says/thinks a file in "In use".
« Last Edit: July 02, 2006, 07:51:46 PM by airbusdriver »
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes:

MamaMoose

  • Guest
Delete Locked Files
« Reply #2 on: July 03, 2006, 02:21:43 AM »
Jack,

I believe there are other software solutions to deleting locked files. I use Trash it! 3.6.1. Try it and see if it works fore you.

MamaMoose

Offline Parker

  • TS Addict
  • *****
  • Posts: 1286
    • View Profile
    • http://www.nyparty.net
Delete Locked Files
« Reply #3 on: July 13, 2006, 11:33:39 PM »
option+apple+shift+delete
force empty trash
deletes everything
locked or not
This account isn't hacked...
I'm actually back from hiatus (and its about darn time too)!

Offline Jack W

  • TS Addict
  • *****
  • Posts: 2597
    • View Profile
Delete Locked Files
« Reply #4 on: July 14, 2006, 10:11:40 AM »
parker,

But, can you put that in an Applescript command line?
Good to be Here.

My Macs: 2010 27" alum iMac 2.8GHz, Snow Leopard 10.6.8/Mavericks 10.9.5, 4GB SDRAM (Workhorse),
13” Late 2010 MacBook Pro 2.4GHz, 10.6.8, 2GB SDRAM,
(2) External HD - Firewire/USB Macally Enclosures  with 1TB Hitachi Drives,
Time Machine external drive - ditto above - 1/2 TimeMac

Offline Parker

  • TS Addict
  • *****
  • Posts: 1286
    • View Profile
    • http://www.nyparty.net
Delete Locked Files
« Reply #5 on: July 14, 2006, 01:22:41 PM »
i don't have much experience with the command line
only thing i know how to do is unhide and rehide hidden folders.

genius bar showed me a little bit of console the other day.

-parker
This account isn't hacked...
I'm actually back from hiatus (and its about darn time too)!

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Delete Locked Files
« Reply #6 on: July 14, 2006, 06:51:48 PM »
From your original question in the thread you started...
QUOTE
I've got a new phenomenon  since updating to Tiger 10.4.6+.
 
 [1] When I try to move a locked file to the trash, or delete, Tiger won't let me do it.
 
 [2] In Jag, I could move to Trash, and then Option-delete.
 
 [3] Is this just me? Or is this a new "Feature" introduced in Tiger?

 [1], [3] True, Tiger won't allow you to move a locked file to the Trash. It's a 'feature' not a bug! wink.gif
 [2] Now you must unlock the file before putting it in the Trash. But even if a Locked file gets into the Trash somehow, you can Delete it with shift-command-delete.
 
 For some reason I can't use the "Fast Reply" button in that thread. dntknw.gif Thinking.gif

There is both a "delete" and an "empty" verb in the Finders AppleScript dictionary. "delete" actually just moves an object to the Trash. "empty" ( and "empty trash" ) is simply defined as "Empty the trash". No word on whether there is any limits on what can be moved or about the "locked" state of those objects. So, you don't need to enter any commands, just use the verbs supplied ( and see what happens! ).
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes:

Offline krissel

  • Administrator
  • TS Addict
  • *****
  • Posts: 14735
    • View Profile
Delete Locked Files
« Reply #7 on: July 14, 2006, 09:33:04 PM »
testing Fast Reply...


A Techsurvivors founder

Offline Parker

  • TS Addict
  • *****
  • Posts: 1286
    • View Profile
    • http://www.nyparty.net
Delete Locked Files
« Reply #8 on: July 14, 2006, 11:34:27 PM »
there's a Automator command to unlock files

http://www.apple.com/downloads/macosx/auto...andfolders.html
This account isn't hacked...
I'm actually back from hiatus (and its about darn time too)!

Offline sandyman

  • TS Addict
  • *****
  • Posts: 978
    • View Profile
    • http://
Delete Locked Files
« Reply #9 on: July 15, 2006, 06:09:32 AM »
Open the terminal
type
sudo rm -f
drag the file to the terminal window
enter your (admin) password when asked.

I've set up F16 to open Terminal as I use it a lot

Offline D76

  • Super Duper Poster
  • ****
  • Posts: 438
    • View Profile
    • http://
Delete Locked Files
« Reply #10 on: July 15, 2006, 07:45:29 AM »
QUOTE(sandyman @ Jul 15 2006, 07:09 AM) <{POST_SNAPBACK}>
type
sudo rm -f
drag the file to the terminal window
enter your (admin) password when asked.
My machine sticks its tongue out and says "illegal option."

Offline Jack W

  • TS Addict
  • *****
  • Posts: 2597
    • View Profile
Delete Locked Files
« Reply #11 on: July 15, 2006, 09:33:09 AM »
gailwin and sandyman,

As I stated, the problem occurs in an Applescript.

The command line where the error occurred:

delete every item of folder "Backups:Backup:Applications"

The recalcitrant file was a Safari History file that had been locked intentionally to keep it "clean". But I understand that in Tiger Safari, you can get it to empty when you close Safari.

So anyway I unlocked it and all is fine now in this particular instance.

I guess Apple thinks they need to protect us from ourselves. And I guess they are right.

Jack
Good to be Here.

My Macs: 2010 27" alum iMac 2.8GHz, Snow Leopard 10.6.8/Mavericks 10.9.5, 4GB SDRAM (Workhorse),
13” Late 2010 MacBook Pro 2.4GHz, 10.6.8, 2GB SDRAM,
(2) External HD - Firewire/USB Macally Enclosures  with 1TB Hitachi Drives,
Time Machine external drive - ditto above - 1/2 TimeMac

Offline kps

  • TS Addict
  • *****
  • Posts: 1693
    • View Profile
    • http://
Delete Locked Files
« Reply #12 on: July 15, 2006, 09:44:55 AM »
rm -rf can fail with locked files. Some locked files need to be unlocked first.

Unlocking the files command:

chflags -R nouchg,noschg *

to find locked files in a folder use:

ls -lo

then:

sudo chflags -R nouchg,noschg folder_name

to trash:

sudo rm -Rf folder_name

Good idea to read up on the use of chflags in the man pages before using the command.

Offline bobw

  • TS Addict
  • *****
  • Posts: 611
    • View Profile
    • http://
Delete Locked Files
« Reply #13 on: July 15, 2006, 10:13:50 AM »
QUOTE(D76 @ Jul 15 2006, 08:45 AM) <{POST_SNAPBACK}>
My machine sticks its tongue out and says "illegal option."



Open the Terminal Application (in Utilities folder) and type:

cd ~/.Trash
    hit return

then type;

sudo rm -rf

put a space after the f and drag the item you want deleted to the terminal so that its path is automatically entered, then press return

give it your admin password and hit return

Offline pendragon

  • TS Addict
  • *****
  • Posts: 7178
    • View Profile
    • http://www.pendragonservices.com
Delete Locked Files
« Reply #14 on: July 15, 2006, 10:33:03 AM »
If you choose to avoid Terminal, Cocktail can easily delete locked or inaccessible files:

1. Launch Cocktail
2. Select the Files tab/pane
3. Navigate to (Choose) the file you wish expunged, click OK, and voilà! clap.gif

I presume OnyX also has this capability.

AFAIK, this always works, but I suppose there are exceptions. dntknw.gif
« Last Edit: July 15, 2006, 10:35:02 AM by pendragon »
Those who can make you believe absurdities can make you commit atrocities. ~ Voltaire