Question about last modified/last written dates

  • Thread starter Thread starter Kelly FitzGerald
  • Start date Start date
K

Kelly FitzGerald

Hi,
I have a question about the logic of the filesystem

Imagine I create a document named dog.txt.

I open it and start modifying it.

Will the time last modified be the time of the first
modifying keystroke I make or when I go to save the
changes?

Also if time last modified and time last written one and
the same?

Thanks,
Kelly
 
Last modified time will be adjusted some time after the application has
modified the file -- just because you're editing data that happens to be in
the file does not mean that the application has, necessarily, modified the
file itself. (The answer here is probably "when you save the changes" or
more accurately "when the application changes the file.") There are a
handful of rules surrounding this if you're trying to get the exact answer,
but that is the general idea.

JR Tipton
 
Hmmm... I'm not sure there's a good writeup beyond the
source code. ;)

For your question about dog.txt... the principle here is that
when an application is given a write-command, that's when
the the last-write time (within some precision and other
rules) is updated. So, assuming the WP app you're running
does no writes EXCEPT at full-save and autosave time, then
the timestamp on the file will be when those events occur.

YMMV.
 
In addition: since you mentioned precision, I think the right thing is
probably to think about doing whatever it is you want to do in another way.
For the vast majority of the reasons you might care about file modified
times, there are other methods which serve you better (change notifications,
change journals, etc). These techniques are described in the Platform SDK.

JR Tipton
 
Back
Top