emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file-attributes returns wrong info on Windows


From: Chris Britton
Subject: Re: file-attributes returns wrong info on Windows
Date: Tue, 18 Jul 2006 01:42:45 -0500

Eli Zaretskii writes:
 > > From: Chris Britton <address@hidden>
 > > Date: Mon, 17 Jul 2006 00:47:24 -0500
 > > Cc: address@hidden
 > > 
 > >  > How do you know which one of these is wrong?  What does DIR say about
 > >  > that file's times?
 > > 
 > > ls (both cygwin and mingw) and Windows XP properties dialog report
 > > that the last modification time on the example file is "March 28, 2006
 > > 2:25:39 AM".  This is in the U.S. Central timezone which is "March 28,
 > > 2006 7:25:39 AM" UTC, or 1143530739 Unix time.
 > 
 > Please invoke "ls -l --full-time", and tell what it tells.  You can
 > see the other two times with full fractional digits if you use the
 > "--time=WHAT" option.

Here's the ls output.

    -rw-rw-rw- 1 cbritton mkpasswd 5171 2006-03-28 01:25:39.000000000 -0600 
d:/work/emacs/README

I'm not sure I would completely trust the fractional portion though.
It could be non-zero and ls might not display enough precision.

I did some debugging and it's definitely the stat call in
emacs/src/w32.c that's returning a modification time of 1143530738 for
my example file instead of the 1143530739 value that the standard
library stat returns.

Also, if I completely remove the stat function from w32.c, the
file-attributes function returns the correct modification time.
I'm not suggesting this as a solution; just another data point.

I suspect that (as Lennart Borgman alluded to earlier) that there is
something going on with the floating-point operations in the stat
function when it's converting from w32 to unix time.  I also suspect
that it's not due to changes in the stat function itself, but some
dependency or optimization.  Just theories though.

I'll continue investigating as time permits.

 > > It would be interesting if someone could repeat my experiment by
 > > calling file-attributes on the same file from both emacs 21 and 22,
 > > and reporting if both versions return identical time values.
 > 
 > Such a comparison is meaningless, AFAIK: CVS clients don't in general

Meaningless?  Not really.  I would find it helpful to know if two
versions of emacs are returning different modification times for the
same physical file (any file) in other environments.  Or, is it just
happening in mine?  CVS has nothing to do with it.

Thanks.

-- 
Chris Britton
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]