Re: flock() issues

From: Date: Sun, 15 Feb 2004 08:28:59 +0000
Subject: Re: flock() issues
Groups: php.windows 
Request: Send a blank email to php-windows+get-22814@lists.php.net to get a copy of this message
Dee Kay,Hello! LOCK_SH doesn't allow you to write something into a file.just for reader. you can use LOCK_EX. ======= 2004-02-15 07:46:36 ======= >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 > = = = = = = = = = = = = = = = = = = = =         Meteorlet         meteorlet@sjtu.edu.cn           2004-02-15

« previous php.windows (#22814) next »