delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/28/11:16:21

Date: Sun, 28 Aug 1994 06:34:44 -0700 (PDT)
From: "Frederick W. Reimer" <fwreimer AT crl DOT com>
Subject: Re: Why TZ=EST5EDT fails
To: eliz AT is DOT elta DOT co DOT il
Cc: DJ Delorie <dj AT ctron DOT com>, storner AT olicom DOT dk, djgpp AT sun DOT soe DOT clarkson DOT edu

On Sun, 28 Aug 1994 eliz AT is DOT elta DOT co DOT il wrote:
> Unlike Unix, DOS sets file creation time using *local clock*, not
> GMT, so copying a file from a remote machine will change the time
> fields which stat() returns (unless, of course, both machines work in
> GMT0 or local wall clock).  

NO NO NO, this can't be correct.  The MSDOS "FILESYSTEM" stores the time 
of the files in local time.  Any DOS, or Unix or whatever, program which 
copies a file from a DOS filesystem to a Unix, or other file system that 
uses TZ's, should automatically convert from DOS's "local" time to GMT.  
Because DOS does not have timezones, the programs should assume that the 
"local" time of the files is in the same timezone as where the machine 
doing the copying is located.  I.E., if you copy a file from a DOS 
diskette to a Unix filesystem with a time of 05:00, the Unix machine 
should assume that that means 05:00 EST if it's located in that 
timezone.  This calculation should be a part of the DOS filesystem driver 
on the Unix system (I personally don't know of any DOS programs that can 
read Unix type filesystems).  So, a file's time should NOT change unless 
you move the file across timezones.  This is really not too much of a 
problem, since transportation methods that commonly transfer files over 
timezones (e.g., FTP) should be using a standard representation of the 
file's time and convert from that standard to the local representation of 
time.  If you have a DOS machine using FTP, there should be some way of 
telling the program what timezone you are in so it can do these 
conversions correctly.  At least this is the way it SHOULD work.


Fred Reimer

+-------------------------------------------------------------+
| The views expressed in the above are solely my own, and are |
| not necessarily the views of my employer.  Have a nice day! |
| PGP2.6 public key available via `finger fwreimer AT crl DOT com`   |
+-------------------------------------------------------------+



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019