[Bug 202545] A small change suggestion for the manual page fopen(3)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Aug 21 11:27:14 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202545

            Bug ID: 202545
           Summary: A small change suggestion for the manual page fopen(3)
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Documentation
          Assignee: freebsd-doc at FreeBSD.org
          Reporter: intron at intron.ac

As so people know, fopen("/path/to/xxxxx.xxx", "w") empties the file if it
exists. I believe that the FreeBSD manual page fopen(3) needs to mention it.

The corresponding POSIX manual page fopen(3p) says:

w or wb       Truncate to zero length or create file for writing.

The corresponding Linux manual page fopen(3) says:

w      Truncate file to zero length or create text file for writing.  The
stream is positioned at the beginning of the file.

The following patch is against:

https://svnweb.freebsd.org/base/head/lib/libc/stdio/fopen.3?revision=266971&view=co

--- fopen.3.orig    2015-08-21 18:48:52 +0800
+++ fopen.3    2015-08-21 18:53:37 +0800
@@ -72,7 +72,7 @@
 .It Dq Li w
 Open for writing.
 The stream is positioned at the beginning of the file.
-Create the file if it does not exist.
+Truncate the file to zero length if it exists or create the file if it does
not exist.
 .It Dq Li a
 Open for writing.
 The stream is positioned at the end of the file.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-doc mailing list