I want to remove a directory, including all files and subdirectories under
it, but without following symlinks. I want the symlinks to be deleted, not
the files pointed to by those symlinks.
E.g. if I have this tree:
parent/
+-- spam/
: +-- a.txt
: +-- b.txt
: +-- eggs/
: : +-- c.txt
: : +-- surprise -> ../../parent
: +-- d.txt
+-- e.txt
and I call remove_tree("parent/spam"), I want the result to be:
parent/
+-- e.txt
(Assuming that I have permission to delete all the files and directories.)
What should I use for "remove_tree"? Do I have to write my own, or does a
solution already exist?
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list