flock() issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can anybody tell me why this code does not work on Windows?

<?
$f1 = fopen("/tmp/a", "a+b");
flock($f1, LOCK_SH);
$f2 = fopen("/tmp/a", "r+b");
fwrite($f2, "test");
?>

It creates zero-length file. On Linux all OK.

If I delete flock() or call flock($f1, LOCK_UN) just after first flock(),
all works correctly.

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux