Re: flock() issues

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

 



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@xxxxxxxxxxx
          2004-02-15


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

  Powered by Linux