Subject: [netatalk-admins] finder view updates

From: Paul Krohn <[email-masked]>
Date: Fri, 2 Oct 98 12:25:15 -0700

I've got netatalk installed on Solaris/Sparc and Linux/PowerPC and i'm 
experiencing the same thing on both: when user A copies a file into a 
folder, and user B has that folder already open, the file does not appear 
until the window is closed and opened again.

I assume this is normal behaviour, I'm just surprised by it because it is 
different from our Netware servers and personal file sharing.

Anyone know of a workaround or a fix for this?

many thanks,

------------
Paul Krohn
San Francisco Examiner Systems Department
110 Fifth Street
San Francisco, CA  94103
415-777-7884
[email-masked] - www.examiner.com

---

From: [email-masked] (Bob Smith, Hammett & Edison, Inc.)
Date: Mon, 05 Oct 1998 12:44:29 -0700

>Anyone know of a workaround or a fix for this?

Paul -

This isn't exactly normal behavior for an AppleShare server, but it is for
netatalk.  If you are using netatalk 1.4b2 this can be fixed, there is a patch
below.  If you are using 1.4b2+asun, it can't be fixed.  Read on for the
explanations!

The problem is the way in which the client finds out about a change that may
require refreshing Finder windows.  With AppleShare 2.1 (netatalk 1.4b2), it
does this by regularily polling the volume mod time for mounted volumes (it
does this about every 5 or 10 seconds).  Netatalk returns the mod time of the
root directory for a volume when it is asked for the volume mod time, so if a
change doesn't occur in the root directory, other afpd's never notice.  This
is fixable in 1.4b2, afpd has an internal volume structure with a volume mod
time in it which stays current, so it is simply a matter of making afpd
utime() the volume root path whenever it changes this internal time.  Here's
the patch:

*** etc/afpd/volume.c-  Tue Oct 22 13:29:04 1996
--- etc/afpd/volume.c   Wed Mar 18 23:05:22 1998
***************
*** 705,709 ****
        syslog( LOG_ERR, "setvoltime: gettimeofday: %m" );
        exit( 1 );
      }
!     vol->v_time = tv.tv_sec;
  }
--- 705,712 ----
        syslog( LOG_ERR, "setvoltime: gettimeofday: %m" );
        exit( 1 );
      }
!     if ( vol->v_time < tv.tv_sec ) {
!       utime( vol->v_path, NULL );
!       vol->v_time = tv.tv_sec;
!     }
  }

However with AFP2.2 (netatalk +asun), the _server_ is responsible for sending
the client a "volume changed attention" packet when a Finder window might need
updating; the client never automatically polls (this is a Good Thing(tm)
because it cuts down on "chatter" especially on a big network).  This doesn't
have anything to do with AppleTalk vs. TCP/IP; this is in the higher levels of
the AppleShare protocol, asun's version which implements AFP2.2 will show this
behavior regardless of the low-level protocol used for a connection.  Although
the above patch will still make it possible for one afpd to know when another
one changes a volume, because the client doesn't poll this time like in
AFP2.1, there is no way to get the information to the client.  It might be
possible to change afpd so it has some sort of interrupt-driven routine that
can check for volume changed conditions and send the attention packet, but
that's beyond my abilities, it would have to be somebody like asun himself who
knows a lot more about the code.

Hope this helps!

Bob Smith
Hammett & Edison, Inc.
[email-masked]