Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stardog24

macrumors newbie
Original poster
Mar 13, 2011
6
0
I have a file in my trash that is impossible to delete...

I click empty trash and everything but this file is gone... I've tried to empty the trash using the Terminal, and I've tried Secure Empty Trash which gives me the message that the finder can not complete the operation as some data can not be read or written (error code -36)

I would appreciate any help on this one...

Cheers,
Stardog
 
The file was on an external drive, however I have had no luck whether the drive is mounted or not...
 
First, drag the file back to your desktop and right click on it and choose "get info" Try to change the permissions on it so that you have permission to read and write.

If that doesn't work open up terminal app (in applications > utilities) and type in "rm" then add a space and then drag the indestructible file into the window and it'll add the file path. Then click enter and it should delete the file. It should look something like this:
Mac:~ username$ rm /Users/username/.Trash/file.rtf

It might just give you a permission error though. In that case you will want to enable the root user: http://support.apple.com/kb/ht1528 and then in terminal enter "su root -p" to switch to the root user and then run the command above again. With the root user you have permission to do anything.
 
Dragging the file to desktop is a no go as it only makes a copy of the file... I can't move the file out of the trash in any way (deleting or moving)...

I have tried the Terminal trick, but I have not tried it as the root user... I'll give it a go and see what happens...

Cheers
 
No luck... Can't even delete as the root user... It may be getting close to format time...
 
Ok... Just looked into the .Trash folder and there is nothing in there, yet still the file is showing up in the Trash Can...

*rips out hair in confusion and anger*
 
Have you checked the file is not locked?

If its not locked try this.

Open terminal and type:

sudo rm -rf ~/.Trash/

Enter the administrator password.

This forces the trash to empty.
 
Did a complete reinstall of OS X and restored from a Time Machine backup and the file is (thankfully) gone... No idea what was causing the problem, but rebooting or force emptying the trash still didn't work...

Ah well... Thanks for the thoughts... :)
 
boot camp?

it is probably a windows file in windows trash - it does this sometimes
 
he could have connected an external drive while running under bootcamp

i have seen bootcamp put un-deletable files into the trash, they typically take the form of files or folders containing the windows user SID

emptying the trash from inside windows fixes this
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.