I am trying to call shutil.rmtree(some_folder), but it is causing an error that another process is using some file in the subtree. This is not the case, so I'm assuming permissions are not set correctly.
How can I change the permissions of all subfolders and files under some root to writeable, so I can call shutil.rmtree and get rid of them?
Thanks
On a platform with the chmod command available, you could do this:
subprocess.call(['chmod', '-R', '+w', some_folder])
Assuming that some_folder is a string that is the full-path to the folder you want to modify.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With