multiple clients updating same file in ftp

Mike Meyer mwm at
Thu Jan 5 16:42:10 EST 2006

"stewart.midwinter at" <stewart.midwinter at> writes:
> here's a simple-minded suggestion: have the first client create a text
> file on the remote server, and delete it when it is finished updating.
> The second client can check for existence of this file before trying to
> update. 

That's an old hack, dating back to at least Unix v6. The problem is
the window between "check for lock file" and "create lock file." The
solution is to use an atomic create-or-fail action for the lock
file. Exatly what that is will depend on your server, but things to
check on are rename and mkdir.

Mike Meyer <mwm at>
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list