[Tutor] File locking: cross platform?

bob gailer bgailer at gmail.com
Fri Feb 20 21:32:09 CET 2009


Bernard Rankin wrote:
> Hello,
>
> What is the correct way to implement cross-platform "flock like" file locking?
>
> Specifically, how would i acquire "exclusive read-write" and "shared read-only" locks for a CGI script that I expect to run on both Windows and Linux servers.

Some other tutor may have a different answer. I propose you 
open(filename, 'r') or open(filename, 'w').

-- 
Bob Gailer
Chapel Hill NC
919-636-4239


More information about the Tutor mailing list