flock() issues
| From: | Dee Kay | Date: | Sat, 14 Feb 2004 23:46:36 +0000 |
| Subject: | flock() issues | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-22813@lists.php.net to get a copy of this message | ||
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.