No flock() in Windows!?

Tim Peters tim.one at home.com
Mon May 7 21:00:59 EDT 2001


[David LeBlanc]
> Windows supports locking down to the byte level on files using the
> _locking() runtime library function. Don't know if or why it's not
> available in a python api.

It's the msvcrt.locking() function, along with (in recent Pythons) the
associated constants (also in msvcrt) LK_LOCK, LK_NBLCK, LK_NBRLCK, LK_RLCK,
LK_UNLCK.  Going to MS and studing the docs is crucial, though, as half those
constants are aliases for the others, and the function rarely turns out to be
what people actually want.

otoh-if-anybody-ever-did-figure-out-how-to-do-what-they-wanted-they-
    kept-it-to-themself-ly y'rs  - tim





More information about the Python-list mailing list