I am using native / C ++ / Win32 / MFC code for Windows to save a document file using MFC serialization. I inserted my own CFile-derived class into the writing process, giving me access to the data as it is written. This allows me to calculate the checksum (or hash, etc.) from data like its output to a file.
After saving the files, I would like to allow the ability to check the file. The idea was to reopen the file and read it by checking the checksum / hash / etc.
I am interested, however, if it is possible that after he just wrote the file, the OS can give me unwritten data when I read the file right away. In this case, the test does not actually tell me that the file looks good on disk.
Is my concern valid? If so, is there a way to avoid this problem?
source share