This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/4627: ios::ate open does not seek to EOF, it truncates
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, tmwg-gcc at inxservices dot com
- Subject: Re: libstdc++/4627: ios::ate open does not seek to EOF, it truncates
- From: rodrigc at gcc dot gnu dot org
- Date: 21 Oct 2001 02:54:03 -0000
Synopsis: ios::ate open does not seek to EOF, it truncates
State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Sat Oct 20 19:54:02 2001
State-Changed-Why:
Look at page 659 of the ISO C++ standard.
If you open an ofstream for writing, if you
do not specify ios::app, then it
will be equivalent to opening the file
with fopen() with the "w" mode. This will
truncate the file before writing to it.
So, if you want to open an ofstream for writing,
add ios::app to the mode if you want to append to it.
Not a gcc bug.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4627&database=gcc