On Tue, 2006-25-04 at 16:41 -0500, JupiterHost.Net wrote: > althought technically any rm -rf (ven the shell itself) has a race > condition since it could clean out directory, move on and then, someone > adds a file between cleaning out the directory and its removal.
Sorry, there is no such race condition in UNIX but there might be in other OSes. When you open a file in UNIX, you are sitting on the i-node, not the directory. Even if its link count has dropped to zero, the file is still open and you are still writing to it (and using up disk space). It's only after the file is closed does it get deleted. Reading or writing to a file that has no directory entry is not a problem in UNIX. The i-node and the file's contents are not freed until every program using it has closed it. Of course, like I said, this may not be true for other OSes. If you are writing a portable script, you should keep this in mind. -- __END__ Just my 0.00000002 million dollars worth, --- Shawn "For the things we have to learn before we can do them, we learn by doing them." Aristotle * Perl tutorials at http://perlmonks.org/?node=Tutorials * A searchable perldoc is at http://perldoc.perl.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>