note 55882 added to function.flock
| From: | fackelkindhonorsocietyde at osu1 dot php dot net | Date: | Tue, 16 Aug 2005 14:58:38 +0000 |
| Subject: | note 55882 added to function.flock | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93744@lists.php.net to get a copy of this message | ||
If found a handy way for myself, to handle a filelock on linux and windows:
<?php
function &file_lock (&$handle, $lock = true){
while (false === flock ($handle, ($lock == false) ? LOCK_UN : LOCK_EX + LOCK_NB))
usleep (300);
}
?>
May it help
So far
----
Manual Page -- http://www.php.net/manual/en/function.flock.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55882
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55882&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55882&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55882&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55882&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55882&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55882&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55882&report=yes
Search -- http://master.php.net/manage/user-notes.php