msvcrt, open_osfhandle, locking

John Nielsen nielsenjf at my-deja.com
Fri Feb 25 17:05:11 EST 2000


If you don't mind win32 calls, you can also use CreateFile and
LockFileEX to do flock style locking. There's an example of it in the
win32 overviews section of pythonwin (if you have a recent version).

john


In article <hvzt4.66$I77.2156 at news.more.net>,
  "Jeff Kunce" <kuncej at mail.conservation.state.mo.us> wrote:
> > >Oops - meant "locking function in msvcrt module"
> >
> > Hmmm. Do you have an example? I can't get it to work.
>
> A while back I wanted file locking with the same API
> on both unix and NT. I worked up something based on
> posixfile, that uses msvcrt on the NT side. I never used it
> production, so handle with care, but it might give you
> some ideas. See:
>   ntposixfile.py
> at:
>   http://starship.python.net/crew/jjkunce/
>
>   --Jeff
>
>

--
nielsenjf at my-Deja.com


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list