Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change file access permissions in linux?

Tags:

python

How does one change file access permissions?

f = open('test','w')
f.close()

Defaults access permissions: 10600

like image 325
bdfy Avatar asked Aug 11 '11 09:08

bdfy


2 Answers

You can use os.chmod

os.chmod(path, mode)

You probably want to use an octal integer literal, like 0777 for the mode.

like image 182
t3h2mas Avatar answered Sep 23 '22 19:09

t3h2mas


Use os.chmod(path, mode)

like image 42
Reto Aebersold Avatar answered Sep 24 '22 19:09

Reto Aebersold