This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Why does ls report some directory dates as future?



OK, I think I figured out why this is happening.  On FAT filesystems,
there is no directory entry for the root directory, so there is no
place to store the timestamp.  Sorry, just isn't there.  Win32 returns
a zero when asked for it.

However, there was a bug in cygwin in that it was incorrectly
converting the zero that Win32 returns for it's timestamp, rather than
just preserving the zero-ness.

So, I changed cygwin (will be in tonight's snapshot) to preserve the
zero-ness.  Now, when you mount a FAT root over an existing directory,
"ls -l" will show a time of around Jan 1 1970, the "epoch" of POSIX
time.  It's still not informative, but at least it's not a random time
in the future.  stat() on such directories will return 0 in the
st_mtime field.

What DJGPP does, which may be difficult to implement in Cygwin, is
that it looks for the volume label on such drives and uses that time
as the root's time, assuming that the volume label was created when
the drive was formatted.  Alternatively, one could scan the whole root
directory and choose the earliest timestamp found.  If anyone wants to
volunteer to do either of these, let us know!

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]