Re: flock problem
| From: | Armand Turpel | Date: | Sat, 28 Feb 2004 19:10:54 +0000 |
| Subject: | Re: flock problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-179079@lists.php.net to get a copy of this message | ||
The problem was that the file was opened for reading and it was locked exclusiv.
$_fp = @fopen($file, "r");
flock($_fp, LOCK_EX);
After change to LOCK_SH it works. What is strange is that not all systems have this behavior. On
linux with php 4.3.4 as module this was not a problem. !?!
Why??
----- Original Message -----
From: "Rasmus Lerdorf" <rasmus@php.net>
To: "Armand Turpel" <armand@a-tu.net>
Cc: <php-general@lists.php.net>
Sent: Saturday, February 28, 2004 8:04 PM
Subject: Re: [PHP] flock problem
> Is the file on an NFS-mounted filesystem? flock() in 4.3.3 works fine.
>
> -Rasmus
>
> On Sat, 28 Feb 2004, Armand Turpel wrote:
>
> > Hi,
> >
> > flock($_fp, LOCK_EX );
> >
> > return always false. I'm relativily shure that the file to flock is not flocked
> > elsewhere. php 4.3.3 is running as cgi on linux.
> > What is going wrong?
> >
> > thanks for an answer.
>
>