This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libstdc++/4627: ios::ate open does not seek to EOF, it truncates


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]