Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RiseAgainst

macrumors regular
Original poster
Jun 10, 2003
152
0
I have this file on my desktop and when i try to delete it it says, "The item <file name here> is being used by another task right now. (Other tasks include moving, copying, or emtying the Trash".

But there is no other task using it. Iv restarted, repaired permissions, tried deleting it as root. Nothing works. I just keep getting the message. PLEASE HELP!
 
First off, if you can boot into OS 9 then do so and delete the file that way. The OS X desktop folder is buried deep in the user's folder so it would probably be easiest just to run a file search to get to it.
 
wow...next time do a search...we had the same problem asked last week, the week before, the week before that...etc...

search versiontracker.com for "deleteit" or Delete It.

or

go into the terminal, type
Code:
sudo rm
and then drag the file into the terminal window (don't forget the space after "rm ".
assuming you have administrator access, enter your password when prompted, and the file will be removed.
 
Originally posted by RiseAgainst
Thanks mnkeybsness, the terminal worked great. Thanks again.

Hold on, I was about to scold mnkeybsness for not reading the original post...

if sudo rm <filename> was something new for you to try, what exactly did you mean in your original message when you said you tried deleting it as root?
 
As in...

Turning on root in Netinfo Manager and logging on through the log on screen as root. For some reason I was not able to delete the file through the GUI. But the terminal worked. Y is that?
 
Re: As in...

Originally posted by RiseAgainst
Turning on root in Netinfo Manager and logging on through the log on screen as root. For some reason I was not able to delete the file through the GUI. But the terminal worked. Y is that?

Good question. I generally advise against enabling root in order to obtain superuser GUI access. It's too easy to screw things up. Unfortunately the only other option in many cases is the terminal. 99.99% of the time that is the lesser of two evils.

I'm not sure why the finder wouldn't let you delete the file while logged in as root. Theoretically it should not have a permissions problem, perhaps the finder was looking at something else, like the lock flag. Whatever it was, sudo rm <filename> should be able to delete just about anything. And while you were logged in as root, typing rm <filename> should have had the same effect as typing sudo rm <filename> as another user.
 
Re: As in...

Originally posted by RiseAgainst
Turning on root in Netinfo Manager and logging on through the log on screen as root. For some reason I was not able to delete the file through the GUI. But the terminal worked. Y is that?
I think it is because of a feature of all versions of Unix, having to do with how files are deleted. I'll explain the background and then my theory.

Unix files really have two parts, which you can think of as the metadata and the data. The metadata includes the name of the file, its owner and permissions, and access dates. The data is the content of the file. The metadata is what you see in a directory listing. When a file is opened by a process (an application, a background task, or the operating system), it is the data that is in use, not the metadata.

When you are allowed to delete a file according to its Unix-level permissions, and you use the rm command in the Terminal window, Unix deletes the metadata of the file you name. Normally, the data is deleted too. However, if any processes have the file open, the metadata is still removed but the data is marked for deletion instead of being deleted immediately. It is deleted when the last process closes the file.

My theory is that the Finder has its own method: that if any process has the file open or if the file has properties known by the Finder that tell the Finder not to delete the file, the Finder says no and doesn't try to delete the file. So that's why the Finder fails and rm works. Utility programs that delete files ignore the Finder properties and do a Unix-level delete.

Just to be thorough, I should mention one more detail. A given data file can actually have more than one set of metadata, i.e., a file can have more than one filename. When one file has two names, it is called a "hard link" between the names. (This is not the same as a "soft link" and not the same as a Mac OS alias.) If you use the rm command and there are hard links to the file you are deleting, the metadata of the file you name will be deleted and the data will be left as is, since it has at least one other filename pointing to it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.