How can one open a file for exclusive access?

Alex Martelli aleax at aleax.it
Mon Jan 14 12:13:38 EST 2002


"Parzival Herzog" <parz at shaw.SpamBucket.ca> wrote in message
news:hhE08.82203$pP5.9609798 at news1.rdc1.mb.home.com...
> I am using Python 2.1 under Windows 2000.
>
> I want to be able to open a file for writing exclusively,
> that while it is open, no other process may read or
> write to that file.
    ...
> So, how, in Python, can one open a file for exclusive
> access?

A good example of such file-locking, cross-platform, is at:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203


Alex






More information about the Python-list mailing list