[Python-Dev] os.path.getmtime on Windows

Christian Tismer tismer at stackless.com
Sun Jan 15 15:13:21 CET 2006


Hi Martin,

>> Is there a way to circumvent this problem, or am I missing something?
>> If this is not the expected behavior, then it might make sense
>> to find a patch.
> 
> I have meant to work on a patch for several years now. I would like to
> drop usage of msvcrt's stat(3), and instead implement os.stat in terms
> of Windows API directly. That would also have the advantage that
> subsecond time-stamps can be exposed.

I see! Still trying to understand the story. I'm working through
the article Tim pointed us at.
http://www.codeproject.com/datetime/dstbugs.asp

Does it mean that msvcrt does extra magic to modify the existing
correct UTC entries? And would usage of the Windows API heal this
immediately, or are extra steps involved?
As I understand the article, things are different when a file is
stored in a FAT or NTFS drive.

Do you think the provided solution is worthwhile to be adapted
for Python?
http://www.codeproject.com/datetime/DstBugs/DstBugs.zip

> There are several issues involved in implementing such a patch, though.
> One is that you need to do it twice: once for Win9x, and once for
> NT+, because you have to use Unicode file names on one system, and
> ANSI file names on the other.

Correcting it just for NT/XP would make the majority of people
happy, IMHO.

cheers - chris
-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/


More information about the Python-Dev mailing list