[netatalk-admins] File timestamps


Subject: [netatalk-admins] File timestamps
From: Devin Reade (gdr@eddore.myrias.com)
Date: Mon Dec 07 1998 - 15:48:45 EST


I'm serving a couple of Apple IIgs machines from a Linux box via a Cayman
Gatorbox CS. I've got Netatalk up and running and everything seems to
be fine except for file timestamps. While a copy from an existing file
to the netatalk-served volume results in a correct timestamp as seen from
the GS, creation of a file by either the GS or the Linux box results in
timestamps that are 30 years in the future (as seen by the GS).

I've tracked this down to the file etc/afpd/file.c (directory.c and volume.c
will be similar) where, if the rez fork of the file doesn't exist, then
the UNIX system time is taken. While this makes sense, there's the slight
difference in that the UNIX epoch is 1 Jan 1970, and the Appleshare epoch
is 1 Jan 2000 (ie: 30 years difference).

While this should be straight-forward to fix, I'm wondering why something
so "obvious" would have been missed so long. Does the Mac perhaps *always*
create a forked file, and therefore the majority of Netatalk users have
never seen the symptoms? (The GS will only create the rez fork when it
is required.) If this is not the case, why do dates on a Mac work out
correctly (as I assume they do)?

I'm using the n-981109 beta edition of Netatalk, plus Apple II patches
(none of which have anything to do with timestamps). Assuming I don't
break anything for the Mac world, I'll submit my final patches for inclusion
in the main distribution.

Devin

-- 
Get a shot off _fast_.  This upsets him long enough to let you make your
second shot perfect.					- Robert Heinlein



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:33:49 EST