Re: Is flock() necessary on a simple file append?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Paul Fierro" <pablo@xxxxxxxxxxx> wrote in message
news:BDA2E4B7.78402%pablo@xxxxxxxxxxxxxx
> On 10/24/2004 5:11 PM, Kevin Grigorenko <kevin@xxxxxxxxxxxxxxxxx> wrote:
>
> > I am appending to a file one line of text on every page hit, so there
could
> > be many occurrences of this append simultaneously.  I am not opening for
> > write ("w") but for append ("a"). Do I need to use flock() to be sure
there
> > are no issues?  I am running on Solaris.
>
> On 10/24/2004 5:39 PM, Hristo Yankov <hristo_y@xxxxxxxxx> wrote:
>
> > append is the same as write (it requires write access
> > for example), so if you are gonna use flock for "w",
> > use it for "a" too.
>
> According to this post, you do not need to use flock() if you open a file
in
> append mode:
>
> http://marc.theaimsgroup.com/?l=php-general&m=105165806915109&w=2

That's exactly what I was looking for; however, I wonder whether that only
applies to the one byte the poster speaks of, or as long as everyone is only
appending.

>
> Paul

Kevin Grigorenko


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux