What's the difference between LastWriteTime and ChangeTime in FILE_BASIC_INFO?
FILE_BASIC_INFO structure contains a number of fields which record the last time a particular action occurred. Two of the fields seem to describe the same thing.
- The time the file was last written to.
The time the file was changed.
What’s the difference between writing to a file and changing it?
I’m told that the difference is metadata. The LastWriteTime covers writes to the file’s data stream (which you accomplish via the
WriteFile function). On the other hand, the ChangeTime also includes changes to the file metadata, such as changing its file attributes (hidden, read-only, etc.) or renaming the file.
(And don’t forget that LastAccessTime updates are off by default now.)