mode for file created by open

Neal Becker ndbecker2 at gmail.com
Sat Jun 9 18:25:12 EDT 2012


Terry Reedy wrote:

> On 6/9/2012 10:08 AM, Devin Jeanpierre wrote:
>> On Sat, Jun 9, 2012 at 7:42 AM, Neal Becker<ndbecker2 at gmail.com>  wrote:
>>> Doesn't anyone else think it would be a good addition to open to specify a
>>> file
>>> creation mode?  Like posix open?  Avoid all these nasty workarounds?
>>
>> I do, although I'm hesitant, because this only applies when mode ==
>> 'w', and open has a large and growing list of parameters.
> 
> The buffer parameter (I believe it is) also does not always apply.
> 
> The original open builtin was a thin wrapper around old C's stdio.open.
> Open no longer has that constraint. After more discussion here, someone
> could open a tracker issue with a specific proposal. Keep in mind that
> 'mode' is already a parameter name for the mode of opening, as opposed
> to the permission mode for subsequent users.
> 

I haven't seen the current code - I'd guess it just uses posix open.

So I would guess it wouldn't be difficult to add the creation mode argument.

How about call it cr_mode?




More information about the Python-list mailing list