|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-02 05:25 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 24 02:00:02 2025 UTC |
hello, Chen i use flocks on Linux, it is always possible to write or read the locked file. Script: <?php $fp = fopen ( 'lock.tmp', 'a+'); if( flock ( $fp, LOCK_EX ) ) { fwrite ( STDOUT, "Lock good...\n"); } else { fwrite ( STDOUT, "Error getting Lock...\n"); } sleep ( 30 ); if( flock ( $fp, LOCK_UN ) ) { fwrite ( STDOUT, "Lock release good...\n"); } else { fwrite ( STDOUT, "Error released Lock...\n"); } ?> during sleep, i run "echo test >> lock.tmp" under shell. And it is works fine. On windows 2000, it is seems to works.