View Single Post
Re: ofstream is not writing!!
Status: Offline
Posts: 3
Join Date: Jan 2009
Thumbs down Re: ofstream is not writing!! - 19-01-2009

I changed my code here as DrEvil said:

Code:, std::fstream::app | std::fstream::out);
and here to try to find out why it's not working:
   if (!DatabaseHelper::write)
                  std::cout << "Stream Error:  " <<  (int)DatabaseHelper::write.rdstate() << std::endl;
using out flag did not help, and the return from rdstate() is always 4, that means failbit.

closing the stream after writing as Cheseeh said did not help too.

From ios_base.h

Failbit: Indicates that an input operation failed to read the expected
characters, or that an output operation failed to generate the
desired characters.
No success yet. I'll keep trying.

Thank you very much guys... Any help will be very apreciated!
Reply With Quote