[Tutor] Delete directories recursively

Matthew White mwhite3 at ttsd.k12.or.us
Fri Jun 16 17:40:04 CEST 2006


You must change the directory and file permissions before attempting to remove them;
even if you are using a python script.

Take a look at os.chmod()

-mtw

On Fri, Jun 16, 2006 at 10:26:34AM -0500, Amresh Kulkarni (amresh.kulkarni at gmail.com) wrote:
> Hi,
> 
> I need to delete a directory and its sub directories. However all dir's, sub
> dir;s and files have read only access. How do i do this efficeintly using
> the os.walk command.
> I cannot run this command on the dir as it gives me an error due to the read
> only attribute. Is there any other way to do this?
> 
> -- 
> ~~AMRESH~~

> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list