CGIs and file exclusion

Michael Foord fuzzyman at gmail.com
Sat Nov 6 03:17:31 EST 2004


Mike Meyer <mwm at mired.org> wrote in message news:<x73bznsxyd.fsf at guru.mired.org>...
> fuzzyman at gmail.com (Michael Foord) writes:
> 
[snip..]
> >
> > A simple solution that doesn't scale well is to create a file when the
> > access starts. You can check if the file exists and pause until the
> > other process deletes it - with a timeout in case the file gets keft
> > there due to an error.
> >
> > Obviously not an industrial strength solution, but it does work...
> 
> To strengthen the solution, write the process id of the script
> (available via os.getpid()) to the file. If the file doesn't vanish before
> your timeout, you can check to see if the process is still around, and
> kill it.
> 
>      <mike
> 

Thanks - a good suggestion.

Regards,

Fuzzy
http://www.voidspace.org.uk/atlantibots/pythonutils.html



More information about the Python-list mailing list