This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
open-output-file: overwrite or append
- From: Ito Kazumitsu <kaz at maczuka dot gcd dot org>
- To: kawa at sourceware dot org
- Date: Mon, 08 Sep 2014 07:25:10 +0900 (JST)
- Subject: open-output-file: overwrite or append
- Authentication-results: sourceware.org; auth=none
The Kawa document says about open-output-file and open-binary-output-file,
"If a file with the given name already exists, the effect is unspecified".
I woud like a way of specifying overwriting or appending for opening an
output file.
Without this option, when we want the target file to be overwritten
if it exists, which I assume is the usual case, we have to make sure
that the file does not exit.
I think, in many programming languages, when opening an output file,
overwriting is the default and appending is an option.
It may be a better practice to avoid overwriting to an existing file
by always writing to a temporary file. Does Kawa recommend this practice?
It is safer but less convevient.