note 40058 rejected from function.flock by vincent
| From: | vincent@php.net | Date: | Fri, 20 Feb 2004 12:35:19 +0000 |
| Subject: | note 40058 rejected from function.flock by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65441@lists.php.net to get a copy of this message | ||
Note Submitter: oli.brouckaert@i-services.be
----
Hello,
flock works fine with NFS ! why do you say it doesn't work ?
I have 2 scripts :
- flock1.php that writes into a file on the NFS path
- flock2.php that writes in the same file and sleep 10 seconds into the if(flock($fp,2)) {}
when I execute flock1.php several times, the file is modify in less that 1 second
when I execute flock2.php (with its sleep(10)), and after 5 seconds execute flock1.php, flock1.php
wait 5 seconds till flock2.php is finished. So there is a lock on the file (on the NFS path) and it
works
Olivier