How can I delete a "stuck" file?

mindbend

Registered
My trash currently has a file I can't get rid of. It is in the Trash of an external Firewire drive. It's actually a Folder, not a file.

Upon requesting a Trash emptying, it says that the file is "in use". The Folder is not in use, I have rebooted, etc.

This "stuck" file was the result of a wicked and very scary event in which a whole bunch of files on the external FW drive suddenly decided to start disppearing. Literally, right in front of my eyes I could watch them deleting themselves one by one. In the end I lost about fifteen files (all backed up, so no big deal). I also ended up with two files that were identical, yet in the same directory, which is not allowed of course. The file names were the same, creation/mod dates the same, everything. Very weird.

So I decided to delete the whole directory just to "clean" out whatever weird thing/corruption may have happened. And now I'm stuck with a folder that won't trash.

I'm not savvy with the terminal, but any suggestions there I'll try I guess.
 
Open a new terminal window and and type this
Code:
cd /Volumes/name_of_external_volume/.trash
sudo rm -r *

This will force delete everything in the ".trash" folder on that particular volume, which is where items in the trash are stored.

Be careful though, make sure you're in the .trash folder or else you'll delete something you don't mean to delete! Sometimes that folder is also called .trashes, they're equivalent as far as I know.

Then all you have to do is go back to the Finder and empty the trash (this will reset the Dock icon to an empty bin, which emptying the trash in the terminal won't do). This will also remove all of the folders called ".trash" on your mounted volumes and home folde; (which is how the Finder determines whether to display an empty or full bin in the dock: it looks for folders called ".trash").

By the way there is a FAQ on this...allbeit for home folders and not volumes...
 
if you don't want to mess with the terminal, get 'Maintain' at versiontracker, use the delete file button. it will basically automate what machael described.
 
You can also use Trash It !, little freeware available at Version tracker that force trashes very well although quite slowly.
 
I have tried all of the posted suggestions with no success. They all return the same "Directory Not Empty" message and leave the file intact.

Any more suggestions?
 
well, when it relates to the directory, i'd move on to disk repair utilities. first disk utility or fsck, then DiskWarrior if that didn't work.
 
Disk Utility did it. I have no idea why I didn't try that immediately. Crazy concept...disk-related problem, maybe run Disk Utility....
 
Originally posted by mindbend
Disk Utility did it. I have no idea why I didn't try that immediately. Crazy concept...disk-related problem, maybe run Disk Utility....

Here's the way I used to do it. I'd just place the file on my OS X desktop. Reboot in OS 9 and find the file in the Desktop folder and trash it while in OS 9. Then I'd just reboot back in OS X. The last time I tried this, I couldn't boot in ANY OS because for some reason, the Mac couldn't recognize any OS on either drive. I ended up re-installing all my stuff (took several tries..don't ask, I wasn't thinking straight), BUT I don't think it was because I did the trash thing. I hadn't done maintenence on my Mac in a long while, knowing it needed it. I'm pretty sure I would have been able to get it back up w/ a Disk Utility app, but I needed a clean install anyway.

kafene.
 
Back
Top