2

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?

2
  • would be good to check permissions for it, what do you get for ls -le?
    – cobbal
    Aug 25, 2009 at 2:08
  • @cobbal, You'll note that I already mentioned using "sudo" to attempt to remove it, right? Aug 25, 2009 at 2:10

4 Answers 4

3

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

1
  • 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. Aug 25, 2009 at 16:49
3

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")'
3
  • 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. Aug 25, 2009 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. Aug 25, 2009 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' Aug 25, 2009 at 10:50
2

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 {} \;
1
  • Unfortunately, "ls -i" has the same problem: ls -i ls: \004␀␀␀õ\001␀␀.õ\001␀: File name too long Aug 25, 2009 at 2:36
1

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

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

You must log in to answer this question.

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