This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Use sub-second resolution to determine if a file is newer
Type: enhancement Stage: resolved
Components: Distutils2 Versions: Python 3.3
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: tarek Nosy List: alexis, benjamin.peterson, eric.araujo, jsjgruber, tarek
Priority: normal Keywords:

Created on 2011-05-04 02:23 by jsjgruber, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg135090 - (view) Author: John S. Gruber (jsjgruber) Date: 2011-05-04 02:23
This report is meant to prompt discussion, if desired, on the advisability of distinguishing new files from old using subsecond data. (It isn't clear to me that it is important to do this.)

Some file systems keep sub-second modification times, but the number of seconds since the epoch grows to a very large number, and given the limited number of significant bits in floating point numbers, it's important to carry out this comparison carefully (or use some new integer data) so newly created files don't appear to be older than their source files due to rounding and other conversion anomalies. Current floats don't have the precision to hold both the number of seconds since the epoch and a nanosecond precision fractional second.
msg135091 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-05-04 02:42
Is this proposing some sort of change or problem?
msg135092 - (view) Author: John S. Gruber (jsjgruber) Date: 2011-05-04 03:00
Thanks for writing so quickly.

This topic arose as part of issue 11933 (similar number).  Éric Araujo asked that I bring this up in either mail to the fellowship of the packaging or as a separate bug report, so I chose to file this. Please see msg 134634 from that issue. I suppose Éric may believe sub-second time comparison is a possibility for distutils2. I think *if* it is done the integer/float conversion implication should be considered, given my limited experience with the topic in distutils.i

Thanks again.
msg135136 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-04 16:05
To quote the initial message:

> If it were desired to determine which file was newer using sub-second
> values, perhaps that would make a reasonable change in distutils2,
> but files created with a few microseconds would have to be considered
> equivalent due to the reduced precision available in python floats
> (53 bits on my platform, if I understand correctly) as compared to
> the 64 bit precision used by some operating systems and file systems.
msg137551 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-03 16:38
For the resolution problem, see #11457.
Date User Action Args
2022-04-11 14:57:16adminsetgithub: 56202
2014-03-13 20:15:07eric.araujosetstatus: open -> closed
resolution: out of date
stage: resolved
2011-06-03 16:38:30eric.araujosetmessages: + msg137551
2011-05-04 16:05:03eric.araujosettitle: Is it desired to distinguish new files from old with sub-second resolution? -> Use sub-second resolution to determine if a file is newer
messages: + msg135136
versions: + Python 3.3, - Python 2.7
2011-05-04 03:00:22jsjgrubersetmessages: + msg135092
2011-05-04 02:42:37benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg135091
2011-05-04 02:23:47jsjgrubercreate