This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: ofstream problem: works in 2.96, failes in RH 9's 3.2.2-5
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Ben Greear <greearb at candelatech dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 30 Apr 2003 11:48:36 +0100
- Subject: Re: ofstream problem: works in 2.96, failes in RH 9's 3.2.2-5
- References: <3EADEF6C.5030400@candelatech.com>
On Mon, Apr 28, 2003 at 08:20:12PM -0700, Ben Greear wrote:
> I have a LogStream class that inherits from ofstream. This code has worked
> for ages on RH 7.0 - RH 8 timeframes...and probably before. (I don't know
> the exact compiler versions...)
>
> However, it does not write anything to disk with the RH 9 g++ compiler,
> though it does create the file.
>
> Please let me know if you have any idea why. I am attaching my LogStream.h
> header and a small test program.
See the FAQ:
http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#4_4_iostreamclear
Calling std::ofstream::close() sets failbit, and std::ofstream::open()
doesn't clear it, so all subsequent writes fail.
jon
--
I eat my peas with honey, I've done it all my life
It makes them taste quite funny, but it keeps them on the knife
- The Orb