Re: Bug in fat-fs code: file date/time wrong

Peter Daum (gator@cs.tu-berlin.de)
Fri, 12 Nov 1999 10:07:57 +0100 (MET)


On Thu, 11 Nov 1999, Richard B. Johnson wrote:

> On Thu, 11 Nov 1999, Peter Daum wrote:
>
> > Hi,
> >
> > it seems, that the calculation of fat/vfat file times in the
> > linux kernel is incorrect. Consider the following DOS directory
> > listing:
> [SNIPPED.....]
>
> It is a common problem. The TZ variable seen by the DOS application
> that writes these files has not been set.
>
> @Echo OFF
> ::
> :: AUTOEXEC.BAT Created 11-APR-1983 Richard B. Johnson
> ::
> Set TZ=EST4
> Set COMSPEC=C:\DOS\COMMAND.COM

DOS doesn't know (nor does it care) about time zones; it assumes,
that your computer's clock keeps local time and this is the only
time it deals with. So the time stamps on a file system written by
DOS normally contain the date/time in the local time (possibly
plus DST) at the time they have been written.

When such a file system is read under linux, it is reasonable to
assume that the files have been written in the same time zone
that is currently in effect - as far as I can tell this is also
the assumption behind the code in fs/fat/misc.c that I quoted.

The problem is, that the timestamps are converted back and forth
between local time and Unix time and that only for *some* dates
you get the original timestamp back...

regards,
Peter

-- 
                                             __o  
     Peter Daum <gator at cs.tu-berlin.de> _'\<_ 
       - pgp messages welcome -       ____(_)/(_)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/