note 40058 added to function.flock
| From: | oli dot brouckaert at i-services dot be | Date: | Fri, 20 Feb 2004 11:59:18 +0000 |
| Subject: | note 40058 added to function.flock | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65440@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.flock.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40058
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40058&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40058&report=yes
Search -- http://master.php.net/manage/user-notes.php