No flock() in Windows!?

Jonathan Feinberg jdf at pobox.com
Mon May 7 17:35:31 EDT 2001


David LeBlanc <whisper at oz.nospamnet> writes:

> In article <7kzt29he.fsf at pobox.com>, jdf at pobox.com says...
> > How do you folks write cross-platform scripts that safely provide for
> > advisory locking?

> 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.

Thank you, David.  I was indeed aware of the MS locking API, and will
probably resort to its use.  But I am kind of shocked that Python
doesn't do it for you via the flock() API.  I'm looking for a
cross-platform solution.

I don't know if I have the chops to write my own cross-platform
locking module, but I guess it would be fun to try.

-- 
Jonathan Feinberg   jdf at pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf



More information about the Python-list mailing list