0

I want to give full permission to a directory and its content in Ubuntu using python. I found a solution here using os.walk:

for dirpath, dirnames, filenames in os.walk('.'):
     for filename in filenames:
        path = os.path.join(dirpath, filename)
        os.chmod(path, 0o777) # for example

But I wonder if there isn't a more simple/elegant solution?

Community
  • 1
  • 1
Joost Döbken
  • 3,450
  • 2
  • 35
  • 79

1 Answers1

0

using subprocess module: call("chmod -R 777 "+folder)

kain64b
  • 2,258
  • 2
  • 15
  • 27