"Tim Williams" <[EMAIL PROTECTED]> writes: > My reply was in response to a post that mentioned a known problem with > this, what happens when the previously running program doesn't exit > gracefully, and leaves the directory in place ??
Don't use the presence or absence of a file as a lock. Have the file there all the time, and have the app open it and use fcntl to get an exclusive kernel lock on the file descriptor. That lock should go away when the process exits, so you don't have to worry about cleaning it up. See "man fcntl" for details. -- http://mail.python.org/mailman/listinfo/python-list