file name has become corrupted and i can't rename or delete it

I'm on a MacBook Pro running OS 10.11.2.


I've been using Carbon Copy Cloner for backup for over a year with no problems. It's always done exactly what I expect from it, and I don't know how it is related to this problem, but it is the program that revealed the problem.


I ran a CCC backup this evening, and for the first time ever I got a message saying there had been an error. I looked at the log and it said that an error had occurred while transferring a file. The file is buried many folders deep on my desktop, and up until now it had always been named "10/12/94". However the file has now acquired the name "10/12/94␀JIMJ@jhuvm.hcf.j␀Re 4" -- it now contains special characters, and it may contain invisible special characters as well. (Note that the file is a text file of emails, so the "JIMJ@jhuvm.hcf" in the corrupted name is probably the beginning of the email address of a message in the file).


I have no idea what caused the renaming -- whether CCC caused the problem or just discovered it. I ran my last backup 6 days ago with no problems, and I've not done anything weird to my computer since then. The file that is causing the problem is one that I haven't looked at in years, and I haven't been within four or five folder levels of that file since I copied it onto my computer from my old laptop.


I tried deleting the file from the finder and I get a message that "The operation can't be completed because an unexpected error occurred (error code -50)." I tried renaming the file from the finder, and no matter what new name I type I get a message that the name can't be used.


I tried deleting the file from the terminal with rm and i get an "Invalid Argument" error.

I tried deleting the file using the trash option in the Onyx utility application, and i get an "Invalid Argument" error.

I tried deleting the file using the Trash It! utility application, and I get an "Invalid Argument" error.


I have also tried all these deletion options on the enclosing folder as well, and they all fail in that case.


I ran Disk Utility on the drive and it discovered no errors. I also ran Onyx's drive verification and it discovered no errors.


I tried a variety of Google search terms and tried many different suggestions that came up, but nothing has worked.


Does anyone have any idea how I can rename and/or delete this file? After running this evening's backup I now have it on both my laptop and my backup.


Thanks.

MacBook Pro, OS X El Capitan (10.11.2)

Posted on Jan 23, 2016 9:08 PM

Reply
11 replies

Sep 1, 2016 7:24 AM in response to philbutrin

I have the exact same problem. Somehow the name of one of my files became corrupted and now contains special characters. It looks like this when I display it "00_04_0Ⰷ␀if". When I try deleting it from the finder I get the "The operation can't be completed because an unexpected error occurred (error code -50)" and when I try to delete it from the terminal I get an "Invalid Argument" error.


I've seen many others on this forum with the same problem but no one has been able to solve it yet. This is not a problem with file permissions or file ownership or the file being in use or anything like that. Disk Utility, TechTool Pro, Disk Warrior, and Hard Disk Manager can't fix the problem. The file can't be deleted, renamed, or moved. You can't delete the enclosing folder because it has this corrupted file in it. Although you can move and rename the enclosing folder. It boils down to the fact that the file system is confused by the special characters in the file name.


Isn't there a Unix Guru somewhere out there that has a clue how to get rid of a file with a corrupted name?

Sep 1, 2016 9:03 AM in response to philbutrin

Filenames with nul in them cannot be removed from your OS X El Capitan filesystem by any means, including root privileges, disabling System Integrity Protection (SIP), or in El Capitan Recovery mode. Don't bother. Others have spent countless hours and frustration trying.


The solution is to boot from an older version of OS X (e.g. Yosemite), and then you can use root privileges to apply the normal Terminal remove (rm) command on that filename in the El Capitan filesystem.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

file name has become corrupted and i can't rename or delete it

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.