On 2006-07-15 18:52:10, Sybren Stuvel wrote: > Elmo Mäntynen enlightened us with: >> Only locally. I want to be able to read/write to a single file from >> multiple possibly parallel processes. Would 'touch lock' (or >> something like that) work reliably (this just occured to me)? > > I use a lock directory for that, os.mkdir('/var/lock/somedir'). > If you use a file, you need two steps: > 1) Check whether the lock-file exists > 2) Create the lock-file
cvsnt for example used to use lock files. Now it uses a lock server: a server app that just sits there and allows different processes to acquire, check for and release locks on files. More implementation work, probably, but more efficient. Gerhard -- http://mail.python.org/mailman/listinfo/python-list