delete files/dirs with read-only mode

Andros andros at no_mail.com
Thu May 1 12:21:25 EDT 2003


Hello,
how to delete an entire directory wich contain files or subdirs with
read-only mode (windows) ?
Is it possible to change the read-only mode for a file or dir ?

Thanks

>>> import shutil
>>> shutil.rmtree('test')
Traceback (most recent call last):
  File "<pyshell#39>", line 1, in ?
    shutil.rmtree('test')
  File "F:\Python22\lib\shutil.py", line 128, in rmtree
    raise exc[0], (exc[1][0], exc[1][1] + ' removing '+cmd[1])
OSError: [Errno 13] Permission denied removing test\test.py






More information about the Python-list mailing list