Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdio Some (mostly minor) wording improvements (IMO)



details:   https://anonhg.NetBSD.org/src/rev/aaced6fb3c12
branches:  trunk
changeset: 827585:aaced6fb3c12
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Nov 04 08:04:40 2017 +0000

description:
Some (mostly minor) wording improvements (IMO)

diffstat:

 lib/libc/stdio/fopen.3 |  35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diffs (83 lines):

diff -r 3e68c15bc9f2 -r aaced6fb3c12 lib/libc/stdio/fopen.3
--- a/lib/libc/stdio/fopen.3    Sat Nov 04 07:59:17 2017 +0000
+++ b/lib/libc/stdio/fopen.3    Sat Nov 04 08:04:40 2017 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: fopen.3,v 1.33 2017/11/04 07:59:17 wiz Exp $
+.\"    $NetBSD: fopen.3,v 1.34 2017/11/04 08:04:40 kre Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -62,29 +62,30 @@
 The argument
 .Fa mode
 points to a string beginning with one of the following
-sequences (Additional characters may follow these sequences.):
+sequences, which may be followed by additional modifiers
+as indicated below:
 .Bl -tag -width 4n
 .It Dq Li a
-Append; open for writing.
+Append; open an existing or new file for writing in append mode.
 The file is created if it does not exist.
 .It Dq Li a+
-Append; open for reading and writing.
+Open for reading and writing in append mode.
 The file is created if it does not exist.
 .It Dq Li r
-Open for reading.
+Read; open an existing file for reading.
 .It Dq Li r+
-Open for reading and writing.
+Open an existing file for reading and writing.
 .It Dq Li w
-Open for writing.
-Truncate file to zero length or create file.
+Write; open an empty file for writing.
+Truncate an existing file to zero length or create a new file.
 .It Dq Li w+
-Open for reading and writing.
+Open an empty file for reading and writing.
 Truncate file to zero length or create file.
 .El
 .Pp
-Additionally, the
+After one of those, the
 .Fa mode
-string can also include one of the following letters:
+string can also include one or more of the following modifier letters:
 .Bl -tag -width 4n
 .It Sq b
 The letter
@@ -92,8 +93,11 @@
 may appear either as a last character or as a character between the
 characters in any of the two-character strings described above.
 This is strictly for compatibility with
-.St -ansiC
-and has no effect; the
+.St -ansiC ,
+where it means open in
+.Dq binary
+mode which is identical to text mode here,
+so has no effect; the
 .Sq b
 is ignored.
 .It Sq e
@@ -115,7 +119,7 @@
 .Fn fopen
 to regular files; if the file opened is not a regular file,
 .Fn fopen
-will fail.
+will close it, and fail.
 This is a non
 .St -ansiC
 extension.
@@ -135,6 +139,9 @@
 in the mode turns on exclusive open mode to the file
 .Pq Dv O_EXCL
 which means that the file will not be created if it already exists.
+In that case, the
+.Fn fopen
+will fail.
 .El
 .Pp
 Any created files will have mode



Home | Main Index | Thread Index | Old Index