Subject: [netatalk-admins] File timestamps

From: Devin Reade <[email-masked]>
Date: Mon, 7 Dec 1998 13:48:45 -0700 (MST)

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

---

From: a sun <[email-masked]>
Date: Mon, 7 Dec 1998 14:43:52 -0800 (PST)

well, the macs worked correctly pretty much because of the resource
fork stuff. i'd been meaning to look at the date stuff as part of my
appledouble v2 updating, but it wasn't high on my list. in any case, i
just went ahead and fixed it in my current asun2.1.x
line. unfortunately, you get time warpage with old files on the mac
due to the resource forks holding the wrong information. i'll add yet
another volume option so that things will get auto-corrected. bleah.

-a

---

From: Devin Reade <[email-masked]>
Date: Mon, 7 Dec 1998 16:00:45 -0700 (MST)

> just went ahead and fixed it in my current asun2.1.x

Nice turn around time. :)

However, since I used the n-981109.tar.gz archive from terminator, I 
should ask:  How does n-981109 relate to the asun line?  Are they 
divergent versions?

Devin

---

From: a sun <[email-masked]>
Date: Mon, 7 Dec 1998 19:21:14 -0800 (PST)

i thought about the timestamps again, and i realized that i need to
change the hfs module as well. so, if you're using the hfs module with
netatalk right now, let me know what version you're using.

the STREAMS driver should be the same. besides that, n-981109 is using
a newer papd than the one in my patchset, but it doesn't have all the
stuff i've done with afpd. 

-a

---

From: Devin Reade <[email-masked]>
Date: Mon, 7 Dec 1998 21:36:19 -0700 (MST)

> netatalk right now, let me know what version you're using.

I think I've got the hfsfs 0.95 installed, although there's no problem
with upgrading it.  Although I wouldn't mind using HFS with Netatalk,
I've pretty much avoided doing it because of some of the cautions
that were in the documentation.  One in particular I remember has to
do with "user tools"; I think "rm -r" was the example.  I can't avoid
using such tools, especially cvs/rcs, so I've been avoiding exporting
HFS partitions.

> stuff i've done with afpd. 

Ok.  The afpd is (in my case) the most important component, so I guess
I'll be switching over.  Hopefully the previously available Apple II
related patches will not conflict too much with yours.

Devin