Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a strange file in my Trash that doesn't go away when I empty the trash. The file name looks like:


The file is apparently in /Volumes/NO NAME/.Trashes/501/ ("NO NAME" is my boot camp Windows volume, so I'm not even sure why it has a .Trashes directory. If I try to "ls" that file, or even that directory, I get:

ls: \004␀␀␀õ\001␀␀.õ\001␀: File name too long

The same thing happens if I try "sudo ls -le", "sudo ls -la" or "sudo ls -i".

And similar results when I try to rm it or even "find . -type f -print0 | sudo xargs -0 rm"

How can I get rid of it?

share|improve this question
would be good to check permissions for it, what do you get for ls -le? – cobbal Aug 25 '09 at 2:08
@cobbal, You'll note that I already mentioned using "sudo" to attempt to remove it, right? – Paul Tomblin Aug 25 '09 at 2:10
up vote 3 down vote accepted

This person had the same problem, and fixed it by performing a disk check in Windows.

share|improve this answer
Amazing that they had almost exactly the same bogus filename too. I think there must be a bug in the Mac OS FAT32 file system driver that allows something out there to create a file that shouldn't be possible to create on a FAT32 file system. – Paul Tomblin Aug 25 '09 at 16:49

one thing to try would be using lower level calls than ls to list the directory

python -c 'import os; print repr(os.listdir("/Volumes/NO NAME/.Trashes/501/"))'

and if that works, maybe try using the unlink() function

edit: to unlink try

python -c 'import os; os.unlink("/Volumes/NO NAME/.Trashes/501/\x04\xe2\x90\x80\xe2\x90\x80\xe2\x90\x80o\xcc\x83\x01\xe2\x90\x80\xe2\x90\x80.o\xcc\x83\x01\xe2\x90\x80")'
share|improve this answer
That works, (returns ['\x04\xe2\x90\x80\xe2\x90\x80\xe2\x90\x80o\xcc\x83\x01\xe2\x90\x80\xe2\x90\x80.‌​o\xcc\x83\x01\xe2\x90\x80']) but I don't know python so I don't know how to use it to unlink the file. I guess I'll have to try it in perl. – Paul Tomblin Aug 25 '09 at 2:38
Perl doesn't seem to do it. sudo perl -e 'opendir DIR, "."; while ($line = readdir(DIR)) { print "\n[", $line, "]\n"; unlink($line);}' ends up listing the file, but not deleting it. – Paul Tomblin Aug 25 '09 at 2:45
Result from trying to delete it in python: Traceback (most recent call last): File "<string>", line 1, in <module> OSError: [Errno 63] File name too long: '/Volumes/NO NAME/.Trashes/501/\x04\xe2\x90\x80\xe2\x90\x80\xe2\x90\x80o\xcc\x83\x01\xe2\x90\‌​x80\xe2\x90\x80.o\xcc\x83\x01\xe2\x90\x80' – Paul Tomblin Aug 25 '09 at 10:50

Have you tried deleting by inode?

ls -i

will show the files and their inode numbers

$ ls -i *.log
 694197 alf.log         694719 mb.log
 694181 fsck_hfs.log     24190 secure.log
 802696 hdiejectd.log   694195 system.log
1094966 install.log     694396 windowserver.log
  24189 ipfw.log

Then use find to remove by inode (say I wanted to delete mb.log from above):

find . -inum 694719 -exec rm {} \;
share|improve this answer
Unfortunately, "ls -i" has the same problem: ls -i ls: \004␀␀␀õ\001␀␀.õ\001␀: File name too long – Paul Tomblin Aug 25 '09 at 2:36

You could try booting in to Windows, and see if it can delete the file (assuming it can actually see it).

share|improve this answer
Windows will not read HFS+ partition without aid of proprietary tools. To add insult to injury, it's read only too. – LiraNuna Aug 25 '09 at 3:02
He said it was his boot camp volume, so it should be readable by Windows. – mark4o Aug 25 '09 at 3:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .