   Do eof checks "out off file memory" for ofstream
  Do you know if the eof() function for std::ofstream checks for "out of file memory"?   
  What is "file memory"? EOF means End Of File, I.e there's no more data left to read.   ;  Can you explain what you mean by "file memory"?It sounds like you are asking whether it checks if the disk is full. My guess is no, I believe that writes will fail, and the "bad" bit is set.   ;Quote:Original post by rip-offIt sounds like you are asking whether it checks if the disk is full.Yes it was that I meant.Quote:My guess is no, I believe that writes will fail, and the "bad" bit is set.Ok. I just thought if it would alert for ofstream in the same manner as for ifstream but reversely.I would going to use it like:bool PixelFormat::save(ofstream &ofs)// Save to file stream:{// Check if pointers are valid:if (!interPtr.get())// If not:return false;// Return failure.if (ifs.eof())return false;PIXELFORMAT format << ifs;return true;};  I found a usefull link from Google(ofstream "disk full"):http://bytes.com/topic/c/answers/478937-how-check-write-failure-ofstream Edit: Not.http://cs.fit.edu/~mmahoney/cse1502/introcpp.html But this might be.Apparently it is just:if (!ofs)/*...*/;But how can that be? Checked in a statement that the ofstream instance itself returns a boolean expression.[Edited by - programering on August 8, 2010 10:38:25 AM];  It is commond idiom, for checking for object failure state. You can read implementation details here: http://www.artima.com/cppsource/safeboolP.html.   ;  Alright thanks! That too solved.   ;  The EOF is the end of the file, not the medium that stores the file. It wouldn't actually make sense to report errors the way you are (were) thinking.   