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: [email protected]
Reporter: [email protected]
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.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-doc
To unsubscribe, send any mail to "[email protected]"