Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can't delete, rename or unlock a file

My wife (running 10.8.5 on a 13" MacBook Pro July 2012) changed the name of a downloading file seconds before the download completed. She now has a 15.6 Mb .mp3 file on her desktop which can't be played (I have tried MPEG Streamclip as well as Quicktime), deleted ("The operation can't be completed because one or more required items can't be found. (Error code -43)"), renamed, unlocked or have its permissions changed. The information window looks like this:

User uploaded file

Sometimes these "ghost files" can be cleared by relaunching Finder - didn't work, neither did a restart. I used Disk Utility to check the Hard Drive - OK - and correct permissions - lots of changes but not to this file. I tried changing permissions on her desktop folder using "apply to all" but that didn't work. I tried using the command "chflags -R nouchg" in terminal but that didn't work either (found in another discussion) probably because dragging the file to terminal only inserted the name and not the full path to the file. I then tried restoring my wife's desktop file from Time Machine. That removed all the files from her desktop except the errant file without replacing them because Time Machine skipped that step because the permission were incorrect. I spent 3 hours copying the deleted files back manually from the Time Machine Back up.

In the course of copying from Time Machine, I noticed that the back up copy of the errant file on Time Machine was behaving properly, so I copied it back to Desktop hoping that it would simply replace the errant file. Instead, I got two copies of the errant file which now both behave normally:

User uploaded file changed to User uploaded file but when I renamed one of the files, the other lost its properties and went back to being untouchable.

One solution would be to start up from Time Machine (as a network disc - I believe this is possible but haven't done it), completely reformat the Hard Drive and then restore my wife's Hard Drive from the Time Machine back up. This seems like a lengthy and risky procedure just to get rid of this annoying file.

Any other ideas?

MacBook Pro, Mac OS X (10.7.4)

Posted on Nov 26, 2014 5:22 PM

Reply
7 replies

Nov 27, 2014 3:07 PM in response to Eric Root

Because whenever I try to delete it, I get "The operation can't be completed because one or more required items can't be found. (Error code -43)".


When I copied in the good copy both became normal, so I thought that if I tried deleting both at the same time I might succeed but that didn't work either. One copy was deleted and the other went back to the error state. I am guessing that when we look at a (data) file in Finder, there is another descriptor file which carries the icon, permissions et cetera. This descriptor file, or part of it, is missing. When I copy in the good file, Finder relates the descriptor file to both data files with the same name but if I delete one of them, the descriptor is deleted which leaves the remaining data file as an orphan. Since the data file has no permissions, Finder cannot delete it.


I tried looking at the permissions using Terminal and the instructions in Troubleshooting permissions issues in Mac OS X - Apple Support . I couldn't get the "ls -l" command to work but I successfully used "sudo chown yourusername File\ Name1.ext" to change permissions on another Desktop file. It didn't work on the error file however. Presumably if the permissions descriptor is missing even Terminal can't change them.

Nov 28, 2014 9:35 AM in response to kenrick

The following will delete that file immediately, no questions asked:


Pay attention to these directions very carefully, and use at your own risk. One typo (an extra space inserted) could destroy your entire installation. Be absolutely certain that when you enter this command it looks EXACTLY the same for spaces and case (excepting the Chinese characters) as it does here.


Open Terminal.app in Applications>Utilities and enter


sudo rm -rf


Important, leave a space after the -rf and drag the problem file into the Terminal window, which should then appear as:


sudo rm -rf /Users/el/Desktop/xxx.mp3 (with the three Chinese characters replacing the xxx)


There are single spaces only between sudo and rm, between rm and -rf and between -rf and /Users.... (It is possible, but not likely, that the Chinese characters may appear with spaces, including a backslash \ after the file is dragged into Terminal).

Hit enter/return, whereupon you will be asked for your admin password, which won't appear in any form as you type it in. (If you have never used the sudo prefix before in Terminal, you will get a warning. Ignore it and proceed anyway.) Then hit return again. The file should be gone from the Desktop.

If you like, you can do everything here up until hitting enter/return, then post back with resulting command in Terminal copied and pasted before proceeding, so I can check that it's looking OK.

Can't delete, rename or unlock a file

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