Is "shelve" thread-safe on Windows?

Fredrik Lundh fredrik at pythonware.com
Thu Jul 29 11:12:23 EDT 1999


Skip Montanaro <skip at mojam.com> wrote:
>     Andrew> Can anyone suggest a simple way to gain the functionality of
>     Andrew> "shelve" on a Windows platform, but which is safe for handling
>     Andrew> concurrent accesses (like from CGI scripts)?
> 
> You might take a look at file locking.  On Unix there's the fcntl module.
> Not sure if there is similar functionality on Windows.

    http://www.python.org/doc/current/lib/msvcrt-files.html

    msvcrt.locking(file.fileno(), mode, bytes)

if anyone knows how to use the "mode" argument,
please let us know... (and send doc patches to
Fred!).

</F>





More information about the Python-list mailing list