[Python-ideas] Add create mode to open()

David Townshend aquavitae69 at gmail.com
Thu Aug 18 13:21:40 CEST 2011


So if it is cross-platform, then what's the problem?

On Thu, Aug 18, 2011 at 11:35 AM, Antoine Pitrou <solipsis at pitrou.net>wrote:

> On Thu, 18 Aug 2011 07:54:32 +0200
> David Townshend <aquavitae69 at gmail.com>
> wrote:
> >
> > The only problem is that O_EXCL may not be supported on all platforms.
>  Can
> > anyone tell me which platforms these are?
>
> That sounds unlikely. O_EXCL is a POSIX standard. It is also supported
> under Windows by the _open/_wopen compatibility functions (which we use
> for file I/O).
>
> Probably there are very old systems which don't support it, and perhaps
> new systems that don't implement it *correctly* (meaning not
> atomically); for the former I'd say we just don't care (who's gonna run
> Python 3 on a 1995 system?) and for the latter, well, if the OS
> designers think it's fine, let's just expose it as it is.
>
> As for NFS, there's an interesting comment from 2007 here:
> http://lwn.net/Articles/251971/
>
> “My NFS tester shows that it at least appears to work with Linux,
> Solaris and FreeBSD:
> http://www.dovecot.org/list/dovecot/2007-July/024102.html. Looking at
> Linux 2.6 sources it doesn't look like it tries to implement a racy
> O_EXCL check in client side (fs/nfs/nfs3proc.c nfs3_proc_create()), so
> the test's results should be correct. I don't know if other OSes do
> that. I guess it would be nice to have a better O_EXCL tester which
> tries to catch race conditions.”
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110818/7c053978/attachment.html>


More information about the Python-ideas mailing list