From:             bibifoc23 at yahoo dot fr
Operating system: Linux
PHP version:      4.3.2
PHP Bug Type:     Filesystem function related
Bug description:  flock seems to not work

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.


-- 
Edit bug report at http://bugs.php.net/?id=23950&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23950&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23950&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23950&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23950&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23950&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23950&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23950&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23950&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23950&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23950&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23950&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23950&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23950&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23950&r=gnused

Reply via email to