Jump to content
  • Advertisement

Archived

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

johnnyBravo

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

This topic is 5357 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Guest Anonymous Poster
You assumed wrong. Read documentation instead of assuming.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!