-1

I have a bunch of files which have read-only status. It is not possible to change the status manual so I was thinking of a code that I could say change the status of all the files in one folder from read-only. However, I can't find the right coding. Is the python helpful for this case?

Thanks in advance,

lili
  • 1
  • 2
  • I have already tried this one though it does not work. What do you think is the problem? **** import os, shutil, stat K=os.chdir("W:/50_SdiCad/40_Process/existing_dgn/Python") os.chmod(K, stat.S_IWRITE) ****** – lili May 26 '15 at 08:46
  • Tell your OS. Windows or Linux? – Nils Lindemann Oct 28 '16 at 14:48

1 Answers1

1

I don't see the need of python here. You could simply type the below written command in the terminal: chmod -R 777 foldername (777 is just for example)

If you want to stick with python, type the following in the python interpreter:

import subprocess

subprocess.call(['chmod', '-R', '777', 'foldername'])

Community
  • 1
  • 1
Vivek Anand
  • 621
  • 1
  • 7
  • 15