mode for file created by open

Neal Becker ndbecker2 at gmail.com
Fri Jun 8 14:36:18 EDT 2012


If a new file is created by open ('xxx', 'w')

How can I control the file permission bits?  Is my only choice to use chmod 
after opening, or use os.open?

Wouldn't this be a good thing to have as a keyword for open?  Too bad what 
python calls 'mode' is like what posix open calls 'flags', and what posix open 
calls 'mode' is what should go to chmod.




More information about the Python-list mailing list