[svlug] files dated 1940
Bill Schoolcraft
bill at wiliweld.com
Fri Jun 22 22:16:01 PDT 2001
At Fri, 22 Jun 2001 it looks like Stephen Hill composed:
SH-->On Wed, 20 Jun 2001, Bill Schoolcraft wrote:
SH-->> Working on a problem at work inside a Solaris environment and just
SH-->> a few files on the server side (NFS) could not be exported, upon a
SH-->> phone call to the client I discoverd the files in question were
SH-->> dated 1940, I had the customer "touch" the files and they were
SH-->> then exportable.
SH-->
SH-->I can't do the math on this windoze box, but since the Epoch was
SH-->1/1/1970, that would be a pretty large negative number in the date
SH-->(created?) field. The fact that there were several files says that it
SH-->was done by a single event/user. I'd check to see if the modified
SH-->date, or created dates were buggered, since you have already
SH-->touched the last-accessed date.
SH-->
SH-->Is puzzlement, as the King of Siam would say.
SH-->
SH-->Steve
..... I've had an interesting response from the Solaris list I
belong to and asked and received permission to post the following
from the author, it was a real nice view of the same event your
mentioning.
##########_Begin_Post_#############
Date: Thu, 21 Jun 2001 13:40:13 -0400
From: Jon LaBadie <jon at jgcomp.com>
To: Bill Schoolcraft <Bill at wiliweld.com>
Subject: Re: [s-x86] Files dated 10/23/1940 on SunOS-5.7 ??
Dates on unix currently are stored in a "signed" long int,
not an unsigned long int. Witness this definition from
sys/types.h
typedef long time_t;
When signed int reaches its max value, 2G for longs, incrementing
it by 1 makes the new value the maximum NEGATIVE value.
But the same "bit pattern" could be looked upon as an unsigned
value.
Then an incremented 2G is just 2G + 1.
I have a program "ctime" that is just a call to the ctime library
function. It then prints out the same type of string as the date
cmd.
Another pgm, getdate, outputs the number of seconds for a specific
date.
Given these I get:
$ getdate now
993144091 # this number should be the same for
# all unix systems around the world
$ ctime 993144091
Thu Jun 21 13:21:31 2001
2G, maximum for a long int (also the maximum time :) is
2147483647.
Check out ctime with these 4 values.
$ ctime 2147483646
Mon Jan 18 22:14:06 2038
$ ctime 2147483647
Mon Jan 18 22:14:07 2038 # the end of unix time :)
$ ctime 2147483648
Fri Dec 13 16:45:52 1901
$ ctime 2147483649
Fri Dec 13 16:45:53 1901
Now, for your 1940 dates, a few guesses to home in on 1940.
$ ctime 2147483647
Mon Jan 18 22:14:07 2038
$ ctime 3147483647
Mon Aug 21 18:32:31 1933
$ ctime 4147483647
Thu Apr 29 20:19:11 1965
$ ctime 3493144526
Fri Aug 4 11:27:10 1944
So, it looks like the mtime stamp in the inode was about 3.5
billion.
Why? You got me.
Another little odditiy I like to surprise my unix students with is
the TZ (timezone) variable. In the old format my eastern zone
would be refered to as EST5EDT (now it is US/Eastern). The old
format is still accepted. The number in the middle is the number
of hours away from Greenwich, England (time zone zero). If you
set TZ=EST29EDT and then run date, you get yesterday's date and
time. Use EST-19EDT and you get tomorrows date and time.
As ls uses the same routines as date, this affects the ls -l
report.
Now the oddity. On Solaris you can set way off hours. Try
setting
your TZ variable to "Twi300000Lite" to know what the time and date
is in the "TwiLite Zone" :))
jl
###############################################
This was quite a learning experience for me and if the topic of
Solaris offends anyone, please accept my apologies in advance, I
posted this in the intrest of the Unix OS and it's offspring.
--
Bill Schoolcraft
PO Box 210076 -o)
San Francisco CA 94121 /\
"UNIX, A Way Of Life." _\_v
http://forwardslashunix.com
More information about the svlug
mailing list