[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] epoch



At 10:55 AM -0600 6/8/97, Robert Dalgleish wrote:
>The clock has to yield the "same" value on both systems. Files have
>modification
>dates that are taken from the clock, and it would be too horrible to
>contemplate
>programs running in Yellow and Blue Boxes making different decisions on
>the same
>file.

The epoch used in this case is a property of the filesystem. For a Mac HFS
volume, the raw bits on disk are likely Jan 1904 based. For a BSD ffs
volume, they will be Jan 1, 1970 based.

Likewise OS API's have an epoch. If I call stat (the UNIX system call to
get file modification dates) I expect the returned values to have Jan 1
1970 as the epoch. If I call PBHGetFInfo I expect the returned numbers to
be seconds since Jan 1 1904. To make things perfectly clear, if I call
PBHGetFInfo on a BSD ffs volume, the value read from the disk will have to
be converted inside the OS.

Similarly the OS has to "massage" the bits it gets from hardware to put
them into the OS API's date format. This will be done differently in the
Yellow and Blue boxes. (Presumeably using the same lower level piece of
code or by having one routine call the other.)

As to MacPerl, any persistent data (e.g. stuff written to files) should
probably be written in a format that is not dependent on the OS API epoch.
Date strings are one example. One could also use perl routines that return
the date in a standardized numerical format which is platform independent.
(I know there are astronomical standards for this and I imagine someone has
perl code to implement them.)

-Z-



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch