What's the difference between LastWriteTime and ChangeTime in FILE_BASIC_INFO?

Raymond Chen

The 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 Last­Write­Time covers writes to the file’s data stream (which you accomplish via the Write­File function). On the other hand, the Change­Time 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 Last­Access­Time updates are off by default now.)


Discussion is closed.

Feedback usabilla icon