Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: File::Path rmtree too fast for NFS....

by nardo (Friar)
on Aug 09, 2001 at 20:01 UTC ( #103468=note: print w/replies, xml ) Need Help??

in reply to File::Path rmtree too fast for NFS....

Easy way is to just put the rmdir in a loop

$tries = 0; while($tries < 10 && !rmdir($root)) { select(undef, undef, undef, 0.05); $tries++; } if($tries < 10) { ++$count; } else { #unable to rmdir }
Of course the sleep time and number of tries can be tweaked to your liking. This does not wait for just the .nfs files to be removed, if another process put files in the directory it waits for those to be removed too. Since you say it doesn't matter whether the directory is actually deleted, just that it doesn't print any error messages you may simply want to comment out all the carp lines.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://103468]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2022-05-18 14:32 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (71 votes). Check out past polls.