On 30 ene, 06:21, Konrad Mühler <[EMAIL PROTECTED]> wrote: > I try to delete a whole directory-tree using shutil.rmtree(...) > But there are always the hidden files and folders (e.g. from the svn > .svn) left. > > How can I delete -all- files and folders (also the hidden) with python?
I assume you use Windows. You have to reset the "readonly", "system" and "hidden" directory attributes. os.chmod can reset the first one, but for the others you have to use ctypes or the pywin32 package to call the SetFileAttributes function. Of course there is system too: os.system("attrib -r -h -s filename") You could use rmtree once, apply the above on the remaining files and directories -if any- and try rmtree again. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list