How to create a file with read access rights

J

Johny

Is it possible to create a file on Linux with access rights?
For example
owner can read and write into the file
others can only read from the file
Thanks for replies
L.
 
H

half.italian

Is it possible to create a file on Linux with access rights?
For example
owner can read and write into the file
others can only read from the file
Thanks for replies
L.

That all depends on your umask. Most commonly, the default value is
022 which translates to 755 or ower has full control, and all others
can read and execute. If you'd like to change a specific files
permissios with python, look into os.chmod()

~Sean
 
L

Larry Bates

Johny said:
Is it possible to create a file on Linux with access rights?
For example
owner can read and write into the file
others can only read from the file
Thanks for replies
L.
See os.chmod()

-Larry
 
E

Evan Klitzke

Is it possible to create a file on Linux with access rights?
For example
owner can read and write into the file
others can only read from the file
Thanks for replies

Look at the documentation for os.open (for new files) and os.chmod
(for existing files).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top