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

From: Date: Tue, 26 Oct 2004 19:13:14 +0000
Subject: Re: Is flock() necessary on a simple file append?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-200382@lists.php.net to get a copy of this message
"Paul Fierro" <pablo@nothing.com> wrote in message news:BDA2E4B7.78402%pablo@nothing.com... > On 10/24/2004 5:11 PM, Kevin Grigorenko <kevin@myplaceonline.com> 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@yahoo.com> 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

« previous php.general (#200382) next »