#39138 [Fbk->Opn]: LOCK_NB for flock() does not work
| From: | php at koterov dot ru | Date: | Fri, 13 Oct 2006 06:47:58 +0000 |
| Subject: | #39138 [Fbk->Opn]: LOCK_NB for flock() does not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103498@lists.php.net to get a copy of this message | ||
ID: 39138
User updated by: php at koterov dot ru
Reported By: php at koterov dot ru
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: Windows, Linux
PHP Version: 5.1.6
New Comment:
Ah, on Linux bug is reproducible at version 5.1.1. Sorry, I do not have
more recent test machine. On Windows - I've tested 5.1.6, bug is
reproducible.
Previous Comments:
------------------------------------------------------------------------
[2006-10-12 14:44:12] tony2001@php.net
Not reproducible on Linux.
------------------------------------------------------------------------
[2006-10-12 14:19:19] php at koterov dot ru
Description:
------------
<?php
@session_write_close(); // be on the safe side
$f = fopen('/tmp/f.lck', 'a+');
var_dump(flock($f, LOCK_EX | LOCK_NB, $w));
var_dump($w);
sleep(5);
?>
When I run this script concurrently, all results are same: "bool(true)
int(0)". Seems LOCK_NB simply ignored.
P.S.
There is a lot of same bugs (e.g., http://bugs.php.net/bug.php?id=31363
etc.), but they are closed or outdated.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39138&edit=1