delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/29/17:01:58

Date: Mon, 29 Aug 94 12:23:40 CDT
From: "Cave Newt" <roe2 AT midway DOT uchicago DOT edu>
To: eliz AT is DOT elta DOT co DOT il
Subject: Re: Why TZ=EST5EDT fails
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

> (I'm still hoping somebody
> out there will tell us where it's written and how we can get at it).

Yeah, me too...

> ftp is also ok, because it ignores the original file's time and gives it
> the time of download, which is, of course, local time.

Well, OK, but that's a completely trivial example, then.  Anyone can
set a timestamp to the current local time; preserving timestamps is 
what's hard.

> I'm thinking precisely on the case of different timezones.  E.g., I might
> one day show up in your office with a diskette...

If you can find it... :-)

> The real world is not restricted to C programming, either.

Yes, very good point, sorry.  Still, C is the dominant programming language
for most commercial and freeware apps, I think.

> What I meant was that if we were
> certain all programs are compiled with DJGPP, we could ``fix'' the file
> creation routines, so they will store GMT times in the directory entry,

You could only do that if all DOS machines (or DOS users) set TZ properly--
or if the system clock used GMT, but that amounts to the same thing since
users want their DATE and TIME commands to give local time.  This is the 
crux of our whole problem:  the machine has to know what timezone it's in,
because there will always be reasons for wanting *both* local time (for 
clocks/appointments) and GMT (for file transfer).  Whether you use local
time or GMT for timestamps is irrelevant; sooner or later you have to con-
vert something.  (Note that dir/ls and touch all use local time.)

>>            There's a gray zone with respect to machines without a TZ var-
>> iable (MSC assumes PST8PDT, djgpp assumes EST5, emx assumes GMT0, etc.),

> Unix man page for ctime(3) says:

I only meant a gray zone in the sense of what's actually out there and 
what that means for interoperability of programs.  I absolutely agree 
that the absence of TZ *should* imply GMT0.

Btw, what you quoted is not a universal Unix man page (yet).  As I men-
tioned, SGIs don't conform to the zoneinfo stuff (or to Posix) in either
Irix 4.x or 5.x.  Nor do Convex or Cray Unicos.  And all machines I've
tested (Sun, SGI, Convex, Cray) honor the 7-character TZ setting properly,
even with garbage for the timezone names (e.g., my wife's and my initials).
So they can't be too dependent on the zoneinfo files.

(I know Ultrix uses zoneinfo files, but I don't have access to that any-
more.  That probably means OSF/1 does, too.  I can just about guarantee
that SysV.3 does not, at least on a 3B1.  Linux and *BSD presumably do.)

> disabled with #if 0 and EST5 used instead.  I wrote to
> DJ earlier that he should re-enable that fragment.

Yup, I agree.

Greg Roelofs

- Raw text -


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