note 59491 added to function.flock
| From: | plbgnr at osu1 dot php dot net | Date: | Thu, 08 Dec 2005 13:22:56 +0000 |
| Subject: | note 59491 added to function.flock | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99745@lists.php.net to get a copy of this message | ||
bool fclose ( resource handle )
and
resource handle isn't path to file
so previous example won't work (for php4)
and some modifications are needed:
<?php
$file = '/path/to/file.txt';
$rh=fopen ( $file, 'a+' ); // <<<
fwrite ( $rh, '.' ); // <<<
fclose ( $rh ); // <<<
$count = filesize ( $file );
?>
----
Manual Page -- http://www.php.net/manual/en/function.flock.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59491
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59491&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59491&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59491&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59491&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59491&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59491&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59491&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59491&report=yes
Search -- http://master.php.net/manage/user-notes.php