This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ofstream problem: works in 2.96, failes in RH 9's 3.2.2-5


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


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