I just tried it and "ax" does not report an error when the file
exists. It overwrites the existing contents just like "w" does. I
haven't detected any differences between these modes.

On Sun, Jul 8, 2012 at 1:13 PM, Mark Hahn <[email protected]> wrote:
> AFAIK, "w" replaces the file and "ax" returns an error.
>
> On Sun, Jul 8, 2012 at 9:30 AM, Mark Volkmann <[email protected]>
> wrote:
>>
>> On Sun, Jul 8, 2012 at 8:42 AM, Ben Noordhuis <[email protected]> wrote:
>> > On Sun, Jul 8, 2012 at 3:28 PM, Mark Volkmann
>> > <[email protected]> wrote:
>> >> On Sun, Jul 8, 2012 at 8:00 AM, Ben Noordhuis <[email protected]>
>> >> wrote:
>> >>> On Sun, Jul 8, 2012 at 12:08 AM, Mark Volkmann
>> >>> <[email protected]> wrote:
>> >>>> The fs documentation says "Exclusive mode (O_EXCL) ensures that path
>> >>>> is newly created."
>> >>>> Does that make sense for "ax" and "ax+" that append to an existing
>> >>>> file?
>> >>>
>> >>> No.
>> >>
>> >> I'm confused then why the modes "ax" and "ax+" exist.
>> >
>> > Sorry, I should've been less brief.
>> >
>> > The crux is "append to an existing file" - that never happens because
>> > ax and ax+ either create a new file or fail. The new file is opened in
>> > append mode.
>>
>> Suppose the file already exists. What is the difference between using
>> "w" and "ax"? They seem the same.
>>
>> --
>> R. Mark Volkmann
>> Object Computing, Inc.
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en



-- 
R. Mark Volkmann
Object Computing, Inc.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to