Hi all,
I've simple question: LOCK_EX is only effective for file writing or it locks
reading, too?
Ciao,
Stefano
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
E' arrivato EmailBlog, il blog ufficiale di Email.it. Partecipa anche tu!
Clicca qui: http
Andrew Hill wrote:
> $fp = fopen("/tmp/lock.txt", "w+");
> if (flock($fp, LOCK_EX)) { // do an exclusive lock
>fwrite($fp, "$processName\n");
>flock($fp, LOCK_UN); // release the lock
> } else {
>echo "Couldn't lock the file !";
> }
> fclose($fp);
[...]
> In this case, although process
Hi all,
I have a question about the way flock() and fclose() work in PHP.
Consider the following code, slightly modified from the flock() PHP
manual page:
$fp = fopen("/tmp/lock.txt", "w+");
if (flock($fp, LOCK_EX)) { // do an exclusive lock
fwrite($fp, "$processName\n");
flock($fp, LOCK_U
. !?!
Why??
- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Armand Turpel" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, February 28, 2004 8:04 PM
Subject: Re: [PHP] flock problem
> Is the file on an N
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.
> Wha
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.
PHP 4.1.2
SunOS web-unix1 5.7
apache_1.3.22
I'm porting from WIN2000 to Apache/Unix and
having problems with the flock() function. The following :
$fd = fopen ($file, "r");if (flock($fd,
2)) {
...}
"if" statement never returns true...
any ideas?
___
>From the manual:
Note: Because flock() requires a file pointer, you may have to use a
special lock file to protect access to a file that you intend to
truncate by opening it in write mode (with a "w" or "w+" argument to
fopen()).
The manual indicates that you "may" need to use "a special lock
I'm using flock to manage the access of a file. I've noticed that php seems to
wait for the file to be freed up. Is there a ordered que that each request goes
into? And a timeout period, or does it just wait?
David
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMA
9 matches
Mail list logo