strange note in fcntl docs
john at grulic.org.ar
Mon Jan 17 14:23:27 EST 2005
On Mon, Jan 17, 2005 at 09:01:25AM -0600, Skip Montanaro wrote:
> I could have sworn that os.open supported the O_SHLOCK and O_EXLOCK flags.
> I'm pretty sure I've used them in the past, but don't see them now. (They
> aren't in 2.2 either.)
> If you try this:
> O_SHLOCK = 0x0010
> O_EXLOCK = 0x0020
> (those are the definitions on my Mac - YMMV) does
> os.open("somefile", O_SHLOCK|<other flags>)
I grepped for O_..LOCK in /usr/include on my linux computer and came
up barehanded. The flags you mention are not, AFAIK, part of POSIX
(the open(3posix) manpage does not list them). And, even if they were,
the note is *still* wrong and misleading: fcntl is available on
Windows, and os.open's flags won't be.
from http://www.daemon-systems.org/man/open.2.html, I gather that
O_..LOCK are a BSD extension, which is why you have then on the
Mac. But they do *not* belong in posix; they belong in os for your
platform, and the note in fcntl should be removed.
The only way this wouldn't be true is if os.open is extended to
understand O_..LOCK, and call out to flock as needed. That would go
against what I understand is the essence of os.open (i.e., a direct
road to open(2)).
Hmm, if the above sounds a little harsh, sprinkle :)s in. I've had too
John Lenton (john at grulic.org.ar) -- Random fortune:
If you're right 90% of the time, why quibble about the remaining 3%?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 196 bytes
Desc: Digital signature
More information about the Python-list