So, I was wondering why file size (FileInfo.Length) seemed to be more accurate indication of a file modification than File.GetLastWriteTime. I was aware of the fact that the time updated on closing of the stream doing the writing to the file in question, and was willing to accept that. The question was where the heck was this called out…

Here is where it is called out.

Specifically:


When writing to a file, the last write time is not fully updated until all handles used for writing have been closed. Therefore, to ensure an accurate last write time, close the file handle immediately after writing to the file.

The part that is extra sucky is that this update of the Last Write Time does seem to take place on local files (not accessed via a remote UNC path), that is the Last Write Time does seem to change on local files even while the stream changing it is still open.