Message203877
> IIUC, the sequence of events is this:
> 1. touch
> 2. read old_mtime
> 3. date back 10s
> 4. touch
> 5. read mtime
>
> So the time stamp that is set in step 3 is never read, correct? So
> there is no test that it is newer than the 10s-old-stamp, but only
> newer then the recent-stamp (step 2)?
Indeed, the test is that step 4 overrides the timestamp set in step 3
with something that represents "now"; and the heuristic for that is that
the mtime in step 5 is at least as fresh as the mtime in step 2 (the
old_mtime).
So step 3 serves to make sure that the test isn't being fooled by a
coarse timestamp granularity. Another way of doing the same thing (but
more costly) would be to call time.sleep(several seconds). |
|
Date |
User |
Action |
Args |
2013-11-22 21:03:55 | pitrou | set | recipients:
+ pitrou, loewis, tim.golden, brian.curtin |
2013-11-22 21:03:55 | pitrou | link | issue19715 messages |
2013-11-22 21:03:55 | pitrou | create | |
|