On Wed, Oct 22, 2014 at 5:22 PM, Mark Volkmann
<
r.mark....@gmail.com> wrote:
> Thanks for explaining that! Doesn't your explanation mean that the
> documentation is wrong? From what you said, "ax" does NOT fail if path
> exists and does NOT ensure that path is newly created.
No, the documentation is correct. If what you said was true, then
'ax' would be a synonym for 'a'.
'ax' creates and opens the file in append-only mode unless the file
exists. You use 'ax' when you would use 'wx' but also want
append-only semantics.
A typical use case is where a master process opens the log file with
'ax' and, if successful, starts workers that open the file with 'a'.
The 'ax' open mode ensures that the master can't race with other
master processes.