Date: Can it be specific to a shell??

Conor P. Cahill cpcahil at virtech.UUCP
Sat Sep 9 12:27:13 AEST 1989


In article <72074 at yale-celray.yale.UUCP>, zador-anthony at CS.YALE.EDU (anthony zador) writes:
> 
>  How does the UNIX date command know the date?

It performs a time(2) system call which gets the current time in seconds
(actually this is the count of seconds since Jan 1, 1970 12:00am GMT), the
ctime(3) library call is then used to generate the date that we all know
and love.

> Is there some file that is updated?

Nope.

> Must date be the same to all shells on a given machine, 

Yup.

> or can su selectively adjust the date for a given shell?

Nope.

> If a machine A is the disk server for B, what determines
> the date-stamp for a file, A or B?

Depends upon the software you are using for the server, but it probably
is the time on the machine that the file is stored.  RFS uses a mechanism
where it determines the time difference between the two machines at the
start of a connection and this difference is added/subtracted whenever
time containing data about files is passed between the systems.  This
way the times will be consistently relative to each other and not
corrupted by system clocks with largely different times.


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.questions mailing list