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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top