473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to create a file with read access rights

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.

Jun 21 '07 #1
3 1290
On Jun 21, 8:27 am, Johny <pyt...@hope.czwrote:
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

Jun 21 '07 #2
Johny wrote:
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
Jun 21 '07 #3
On 6/21/07, Johny <py****@hope.czwrote:
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).
--
Evan Klitzke <ev**@yelp.com>
Jun 21 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004...
2
by: Mike MacSween | last post by:
I'm not talking Access Users & Groups, I may or may not implement that. Even if I do file/folder rights still need to be managed. I've searched the archives and read the many postings. The basic...
11
by: sur | last post by:
Hello, My problem is that File.Exists works fine if my file is on my local drive but returns false if its on any other drive. I think that the issue is probably file permissions and so I have...
3
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.