Mr. Shawn H. Corey wrote:
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
no need to apologize :) I was simply referring to the infinitely minute
possibility that rm -rf may possibly fail if someone starts doing stuff
in the directory at juuuuust the right moment.
Its only a race condition in the sense that your command may
inexplicably fail, but its not that big of a thing and the chances that
the race would ever win, I mean the timing of it, the kernel smarts, etc
are so slim you;d probably win the lottery several times before it
happens :)
Anyway how rm -rf behaves on various OSs is slightly off topic so back
to the topic:
File::Copy::Recursive at least returns undef on failure so you can try
again if you like and report the error with $!, and its much more
portable than system 'rm', '-rf';
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>