RE: [PHP] Re: Ensure only one instance of a script is running
| From: | Mikey | Date: | Wed, 16 Mar 2005 18:46:57 +0000 |
| Subject: | RE: [PHP] Re: Ensure only one instance of a script is running | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210911@lists.php.net to get a copy of this message | ||
[snip]
> Unluckily, this will not prevent a race condition. The only
> file operations that are guaranteed to be atomic are mkdir()
> and symlink(). Try to create the directory and see if it
> fails. Also remember to rmdir() the lock directory before exiting
How about grabbing the output from
ps -ax and looping thourhgthe results
to see if your script is being run?
HTH,
Mikey