Brian McKee wrote:

On 25/04/06, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote:

Is there a definative way to recreate the gnu `rm -rf` in perl?

You could use rmtree.

perldoc File::Path


Looks good, but then I saw this:
NOTE: There are race conditions internal to the implementation of
       "rmtree" making it unsafe to use on directory trees which may be
       altered or moved while "rmtree" is running, and in particular on any
       directory trees with any path components or subdirectories potentially
       writable by untrusted users.

try the pathrmdir() in File::Copy::Recursive

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.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to