Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Aug 2015 11:27:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-doc@FreeBSD.org
Subject:   [Bug 202545] A small change suggestion for the manual page fopen(3)
Message-ID:  <bug-202545-9@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org
          Reporter: intron@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202545-9>