This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: BZ#10254: Explain additional fopen parameters
- From: Kalle Olavi Niemitalo <kon at iki dot fi>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 09 Apr 2012 15:43:50 +0300
- Subject: Re: BZ#10254: Explain additional fopen parameters
- Keywords: C11
- References: <4F82B27A.30102@suse.com>
Andreas Jaeger <aj@suse.com> writes:
> +@item x
> +Insist on creating a new file---if a file @var{filename} already
> +exists, @code{fopen} fails rather than opening it. If you use
> +@samp{x} you are guaranteed that you will not clobber an existing
> +file. This is equivalent to the @code{O_EXCL} option to the
> +@code{open} function (@pxref{Opening and Closing Files})
This meaning of "x" is also in the N1570 draft of C11. Unless
the ratified C11 standard differs in this, I think the glibc
manual should mention that "x" is not solely a glibc extension,
and that portable programs using "x" should make it the last
character of the string.