Message203967
The "000" or "500" still smells of floating point rounding to me. Windows appears to round-trip the values provided perfectly:
import ctypes
def do_test(t):
h = ctypes.windll.kernel32.CreateFileW("test.txt", 0xC0000000, 7, None, 2, 0, 0)
assert h != -1
try:
mt1 = ctypes.c_uint64(t)
assert ctypes.windll.kernel32.SetFileTime(h, None, None, ctypes.byref(mt1)) != 0
mt2 = ctypes.c_uint64()
assert ctypes.windll.kernel32.GetFileTime(h, None, None, ctypes.byref(mt2)) != 0
assert mt1.value == mt2.value
print(mt2.value)
finally:
assert ctypes.windll.kernel32.CloseHandle(h) != 0
>>> do_test(123)
123
>>> do_test(999999999999999999)
999999999999999999
Now, I'm not going to make any claims about GetSystemTime's accuracy, and there could well be floating point conversions within there that cause the rounding issue, but I'm more inclined to think that one of Python's conversions is at fault.
Of course, an easy way around this would be to sleep for >100ns before touching the file again. |
|
Date |
User |
Action |
Args |
2013-11-23 05:09:49 | steve.dower | set | recipients:
+ steve.dower, tim.peters, loewis, pitrou, tim.golden, jkloth, brian.curtin, python-dev |
2013-11-23 05:09:49 | steve.dower | set | messageid: <1385183389.41.0.865000803983.issue19715@psf.upfronthosting.co.za> |
2013-11-23 05:09:49 | steve.dower | link | issue19715 messages |
2013-11-23 05:09:49 | steve.dower | create | |
|