There's a recipe in the Python Cookbook that addresses this:
http://code.activestate.com/recipes/65203/
There are probably others floating around, too.
Cheers
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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
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.
Thank you,
:)
Jeff,
Just catching up after a week on vacation, but nobody
seems to have picked this up so...
> I'm always disappointed when I find something that Python
> doesn't handle in a platform independent way.
That's often because the platforms all do it too differently! :-)
> 1. I don't see a way to
I'm always disappointed when I find something that Python doesn't handle
in a platform independent way. It seems to me that file locking is in
that boat.
1. I don't see a way to atomically open a file for writing if and only
if it doesn't exist without resorting to os.open and specialized
platfo