Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'You CAN rm files that are in use!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
You CAN rm files that are in use!
Authored by: Anonymous on Mar 16, '04 11:40:41PM

Hello? McFly?

People are suggesting that perhaps the file couldn't be rm'd because it was in use. This is patently wrong. "In use" files can be rm'd under any UNIX system. In fact, a common (ugly) hack to creating private temp files is to create a new file, open it, and then rm it while it is still open.

The rm just tells the file system that the file is gone, but the blocks aren't free'd until the last open file descriptor pointing to that file is closed. So an open file, even one that is actively being written to, can be rm'd.

Just FYI.



[ Reply to This | # ]
You CAN rm files that are in use!
Authored by: stetner on Mar 17, '04 06:35:58AM

Agreed, Nothing should stop you from deleting an in use file (other than that immutable flag which is separate from the in use issue).

If the system was panicing, I would suspect that the file system got corrupt when you ran out of space and trying to rm the file triggered the panic.

In all likelihood, if you had just booted into OS X single user and forced an fsck, you would have cleared it up as well....



[ Reply to This | # ]