rm -rf in python
David Allen
s2mdalle at titan.vcu.edu
Sat Feb 24 16:38:41 EST 2001
In article <m3hf1jsryl.fsf at atrus.jesus.cam.ac.uk>, "Michael Hudson"
<mwh21 at cam.ac.uk> wrote:
> "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?
I hadn't until now...
Searching yields:
http://www.python.org/doc/current/lib/module-shutil.html
Question: I'm not seeing in the documentation for
this whether or not it's good on windows machines.
Is it? In my original code I had to be careful to
use os.sep rather than just "/" because this code
will have to run on microsoft OS's.
--
David Allen
http://opop.nols.com/
----------------------------------------
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore, all
progress depends on the unreasonable man."
- George Bernard Shaw
More information about the Python-list
mailing list