default should be to truncate on open_write

This commit is contained in:
David Rose 2002-11-12 02:07:57 +00:00
parent ad2e154a5d
commit 010a35b735
2 changed files with 5 additions and 1 deletions

View File

@ -1197,6 +1197,10 @@ open_read(ifstream &stream) const {
// appropriately as indicated; it is an error to call
// open_read() without first calling one of set_text()
// or set_binary().
//
// If truncate is true, the file is truncated to zero
// length upon opening it, if it already exists.
// Otherwise, the file is kept at its original length.
////////////////////////////////////////////////////////////////////
bool Filename::
open_write(ofstream &stream, bool truncate) const {

View File

@ -150,7 +150,7 @@ PUBLISHED:
bool scan_directory(vector_string &contents) const;
bool open_read(ifstream &stream) const;
bool open_write(ofstream &stream, bool truncate = false) const;
bool open_write(ofstream &stream, bool truncate = true) const;
bool open_append(ofstream &stream) const;
bool open_read_write(fstream &stream) const;