Date: 10/31/00
- Next message: lrhazi <email protected>: "[PHP-DEV] PHP 4.0 Bug #7560 Updated: strtok or while-loop never returns"
- Previous message: joey <email protected>: "[PHP-DEV] PHP 4.0 Bug #7545 Updated: impossible to send variable"
- In reply to: Daniel T. Gorski: "Re: [PHP-DEV] PHP 4.0 Bug #7554: Exclusive flock() breaks client/servercommunication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Try this instead:
if (!flock($fp2, (LOCK_EX|LOCK_NB)) die("cant lock file 2");
See the manual for more info.
(http://www.php.net/manual/function.flock.php)
On Tue, 31 Oct 2000, Daniel T. Gorski wrote the following to Ignacio...:
> 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>
- Next message: lrhazi <email protected>: "[PHP-DEV] PHP 4.0 Bug #7560 Updated: strtok or while-loop never returns"
- Previous message: joey <email protected>: "[PHP-DEV] PHP 4.0 Bug #7545 Updated: impossible to send variable"
- In reply to: Daniel T. Gorski: "Re: [PHP-DEV] PHP 4.0 Bug #7554: Exclusive flock() breaks client/servercommunication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

