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: Mon, 17 Jul 2006 00:47:24 -0500

Eli Zaretskii writes:
 > > Date: Sat, 15 Jul 2006 16:17:20 -0500
 > > From: Chris Britton <address@hidden>
 > > 
 > >     ;; emacs 21.3
 > >     (file-attributes "D:/Work/emacs/README")
 > >     (nil 1 5 5 (17592 29654) (17448 58611) (17592 29654) 5171 "-rw-rw-rw-" 
 > > nil 0 (16460 . 2902))
 > > 
 > > Here is the result of evaluating the function on the same file in
 > > emacs 22 (cvs head revisions as of 14-July).
 > > 
 > >     ;; emacs 22
 > >     (file-attributes "D:/Work/emacs/README")
 > >     (nil 1 5 5 (17592 29653) (17448 58610) (17592 29654) 5171 "-rw-rw-rw-" 
 > > nil -25401 (16460 . 2902))
 > > 
 > > Note that the last access time, modification time, and inode number
 > > are different.
 > 
 > 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.

file-attributes represents time values as two integers: the first
integer is the high-order 16 bits of the time value and the second is
the low-order 16-bits.

Applying that algorithm to the 1143530739 value yields (17448 58611),
so I concluded that emacs 21.3 was returning the correct value.  That,
plus the fact that vc-directory works correctly under emacs 21, but
under emacs 22 reports that *all* my sources under cvs are modified
even though they are not.

 > > I get the same result whether I build under MinGW or Cygwin.
 > 
 > ??? Do you really mean Cygwin?  That one uses an entirely different
 > implementation of the file I/O functions (such as `stat') invoked by
 > file-attributes.

I'm always suspicious of my cygwin build because I have to use
mingw-make instead of cygwin's make and the mixing of the two may not
be giving me what I expect.  However, I am confident that my MinGW
build knows nothing of cygwin.

I've also tried a pre-built version of emacs 22 to try to isolate if
the problem is my build environment.  The pre-built version exhibited
the same symptoms.  I downloaded it from
http://ourcomments.org/Emacs/DL/EmacsW32+Emacs/Emacs-from-CVS/unpatched/Emacs-22-CvsU060627-EmacsW32-1.06.exe
If anyone wants to point me to additional binary distributions, I'll
be glad to try them.

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.

Let me know if I can provide any further info.

Thanks.

-- 
Chris Britton
address@hidden




reply via email to

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