Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
ferror()
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Dan Pop, post: 1692192"] fclose() does more than fflush(). 2 A successful call to the fclose function causes the stream pointed to by stream to be flushed and the associated file to be ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ closed. ^^^^^^ This is what allows fclose to detect what fflush may not be able to detect. Closing the associated file implies flushing all the buffers associated to that file, even those stdio (and, implicitly, fflush) has no control upon. Have I said or implied otherwise? My point was that this check does NOT make the fclose check superfluous, not that checking fflush is superfluous. Checking fflush is still needed, but only its failure has any relevance, its success does not guarantee that the data has been properly written to its final destination. Only the success of fclose provides such a guarantee. I thought that was clear enough, but it seems that I was overoptimistic. Dan [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
ferror()
Top