Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why I cant see the file content once it is written to a file before the file is closed i.e. before calling fclose() I tried to view the file content using breakpoints?

Experts Pls help me...
Posted
Comments
[no name] 26-Nov-14 7:59am    
Because data are in buffer. You can use fflush to force that data will be written to file (without closing the file).
VidyasagarSTGM 26-Nov-14 22:50pm    
Thanks Bruno...

 
Share this answer
 
Read/write are buffered in C/C++ (and in many more languages and OSs) so until you close the file it may not be complete (even parts of it are already written)...
MSDN:
all buffers associated with the stream are flushed prior to closing
http://msdn.microsoft.com/en-us/library/fxfsw25t.aspx[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Nov-14 11:29am    
5ed.
—SA
Kornfeld Eliyahu Peter 26-Nov-14 12:13pm    
Thank you...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900