bdfy
bdfy

Reputation: 285

How to change file access permissions in linux?

How does one change file access permissions?

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

Defaults access permissions: 10600

Upvotes: 5

Views: 15055

Answers (2)

t3h2mas
t3h2mas

Reputation: 678

You can use os.chmod

os.chmod(path, mode)

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

Upvotes: 20

Reto Aebersold
Reto Aebersold

Reputation: 16624

Use os.chmod(path, mode)

Upvotes: 5

Related Questions