[Melbourne-pm] An intermittent problem with open for append

David Dick ddick at aapt.net.au
Wed May 28 03:03:50 PDT 2008

Mathew Robertson wrote:
> I suspect this is root of the problem, irrespective of NFS -> the 
> webserver is using two instances of the script, to execute the request.
> If two processes open the same file for append, they will both 
> succeed.  Both processes will move their file pointer to the "end of 
> the file" - which both happens to be at the same byte offset. One 
> starts "print"ing... then the other "print"s -> the second write will 
> clobber the first write.
no.  actually, NFS is the important factor for appending  Over nfs (at 
least for older versions), O_APPEND is unreliable.  On a local (modern) 
unix filesystem it is a guarantee.  concept is explained by W.R. Stevens 
in Advanced Programming in the UNIX Environment viewable at 

More information about the Melbourne-pm mailing list