Re: [PHP-DEV] PHP 4.0 Bug #7554: Exclusive flock() breaks client/servercommunication From: Daniel T. Gorski (daniel.gorski <email protected>)
Date: 10/31/00

Hi all,

> $fp1 = fopen("/tmp/test.txt","a");
> if (!$fp1) die("cant open file 1");
> if (!flock($fp1,2)) die("cant lock file 1");
>
> $fp2 = fopen("/tmp/test.txt","a");
> if (!$fp2) die("cant open file 2");
>
> // causes troubles
> if (!flock($fp2,2)) die("cant lock file 2");

[...]

> Are you sure that it isn't blocking on the second fopen()? That's what
> locking is supposed to do.

this second fopen() provides a valid file handle (as expected), the second
flock($fp2,LOCK_EX) on this previously exclusiv-locked file should return
"false" or should die() with a message in this case - right? - it doesn't.
The client-browser is trying (seems infitely) to receive data - or in other
words this script doesn't terminate. I tried it with 4.0.1pl2 now - same
effect.

yours dtg

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>