Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a directory within my iTunes folder structure that has an accent character in it which I am trying to delete.

If I do an ls on the directory I get this:

ls -al ls: Radiů Disney_ Jams Vol. 2: No such file or directory total 0 drwxr-xr-x 3 scott staff 102 Jul 29 13:16 . drwxrwxr-x@ 21 scott staff 782 Jul 29 13:24 ..

I've tried rm -rf * but after that I attempt an ls -l I still get: ls: Radiů Disney_ Jams Vol. 2: No such file or directory

Any way to delete the directory with offending filename? If I attempt to delete the parent directory I get a "Directory not empty message"

share|improve this question
    
That's … fascinating. What do you get if you run echo * | od -t ax1 in the offending directory? I am trying to find out something about the character encoding used here. If you find that the letter ů is encoded as c5 af, that should not have been possible, and it may explain the problem. By Apple's encoding rules for filenames, it should be 75 cc 8a instead. –  Harald Hanche-Olsen Jul 29 '12 at 19:01
    
If you cannot solve this (I suspect that may be the final outcome) you can at least work around it by moving the problematic directory away to some dark corner of the filesystem where it won't bother you. –  Harald Hanche-Olsen Jul 29 '12 at 19:42
    
Thanks for the tip on the encoding check. Here is what I got:scott@death-star { /Volumes/Storage Vault/Christina Aguilera } [!3106] -> echo * | od -t ax1 0000000 R a d i ? ? sp D i s n e y _ sp J 52 61 64 69 c5 af 20 44 69 73 6e 65 79 5f 20 4a 0000020 a m s sp V o l . sp 2 nl 61 6d 73 20 56 6f 6c 2e 20 32 0a 0000033 –  Scott Walter Jul 29 '12 at 19:48
    
I do see the "c5 af". So for now until I decide to reformat the drive I'll just move it into a "dark corner" of my hard drive and ignore it. –  Scott Walter Jul 29 '12 at 19:50
    
Unfortunately no. Deleting the parent directory via "rm -rf" returns a "Directory not empty message" –  Scott Walter Jul 29 '12 at 20:01

1 Answer 1

If you look at this answer from Stack Overflow, you will learn that filenames on HFS must be in fully decomposed form, in which an accent on a letter is encoded separately from the letter itselves (and after the letter). In your case, the filename has somehow been snuck onto the filesystem in composed form instead, which confuses the filesystem to the point where it can see that the file is there, but still cannot find it. If Disk Repair cannot find and fix the problem, I much doubt that there is much you can do. There is an ancient File Name Encoding Repair Utility out there, but as it officially supports OS X 10.1 and 10.2 only, I would be rather hesitant about running it on a modern OS X if I were you. So your best bet is to hide the problematic directory somewhere it won't bother you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.