note 44694 deleted from function.flock by didou
| From: | didou@php.net | Date: | Sat, 30 Oct 2004 14:46:09 +0000 |
| Subject: | note 44694 deleted from function.flock by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79362@lists.php.net to get a copy of this message | ||
Note Submitter: jeppe at bundsgaard dot net
----
To jeroenl and lockwang.
You're right lockwang - but I think it can be solved by adding a check of the file modification
time - and deleting old lock's - say 10 seconds old - and then just hope that whatever caused
the lockfile not to be deleted didn't influence the file you want to write to. So I would add
these lines to jeroenl's script (after $lock=...):
$filemtime=filemtime($lock);
if ($filemtime and time()-$filemtime>10000)
unlink($lock);