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

From: Date: Mon, 25 Oct 2004 22:13:27 +0000
Subject: Re: Is flock() necessary on a simple file append?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200299@lists.php.net to get a copy of this message
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 Paul

« previous php.general (#200299) next »