flock experience

Mike Meyer mwm at mired.org
Tue Jan 14 10:34:12 EST 2003


Robin Becker <robin at jessikat.fsnet.co.uk> writes:
> has anybody good experience using file locking in python. I have the
> typical problem of opening a log file for a short time (cgi environment)
> in a multiprocess world. So far I think we have been lucky, but our 8
> machine front end is contracting to one machine, just for us, so the
> collision probabilities are rising. I see there's a recipe in the pcb,
> but what happens to locked out processes etc etc.

To answer the question actually asked - yes, I've had good experience
using file locking with Python. That is, the locking worked, and kept
the file from being screwed up. However, it's not an experience I'd
care to repeat. File locking is fine for a single file. Once things
got more complicated, it gets messy. I finally punted, and started
logging to an SQL database.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.




More information about the Python-list mailing list