Archived

This topic is now archived and is closed to further replies.

johnnyBravo

FStream.... myFile.flush() won't work

Recommended Posts

I assume the flush() command in FStream clears the file of any data. If not how do i do that. But if so: fstream fFile; fFile.open (filename, fstream::in | fstream::out | fstream::app); fFile.flush(); fFile.close(); but it seems to do nothing to the file Thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Flush is not used to empty out a file. If you want the file to be emptied out, you need to do that with the flags.

There is a good article <a hef="http://www.gamedev.net/reference/articles/article1127.asp">here</a>.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Anonymous Poster
There is a good article <a hef="http://www.gamedev.net/reference/articles/article1127.asp">here</a>.

That article has old info (even though it was submitted in 2000, tsk tsk). It uses <fstream.h> and <iostream.h>. Those contain some things non-existent in the current <fstream> and <iostream> headers. Such as ios::noreplace and ios::nocreate.

Share this post


Link to post
Share on other sites