rm -rf in python

Michael Hudson mwh21 at cam.ac.uk
Sat Feb 24 16:15:30 EST 2001


"David Allen" <s2mdalle at titan.vcu.edu> writes:

> I need to write the equivalent of "rm -rf" in python,
> so I wrote this, but I'm having a hard time understanding
> why it's not working.  
[schnipp]
> Any help would be appreciated.

I haven't read your code, but do you know about shutil.rmtree?

>>> print shutil.rmtree.__doc__ 
Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if
    onerror is set, it is called to handle the error; otherwise, an
    exception is raised.

Hmm, that docstring isn't quite right...

Cheers,
M.

-- 
  ROOSTA:  Ever since you arrived on this planet last night you've
           been going round telling people that you're Zaphod
           Beeblebrox, but that they're not to tell anyone else.
                    -- The Hitch-Hikers Guide to the Galaxy, Episode 7



More information about the Python-list mailing list