mode for file created by open

Devin Jeanpierre jeanpierreda at gmail.com
Fri Jun 8 14:53:54 EDT 2012


On Fri, Jun 8, 2012 at 2:36 PM, Neal Becker <ndbecker2 at gmail.com> wrote:
> 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?

For whatever it's worth, in Python 3.3 you have the additional option
of providing a special file opener.

http://docs.python.org/dev/library/functions.html#open

-- Devin



More information about the Python-list mailing list