[OpenAFS-devel] fakestat/NeXT hack

Patrick J. LoPresti patl@curl.com
18 Nov 2001 11:01:26 -0500


Derek Atkins <warlord@MIT.EDU> writes:

> Keep in mind that this may not be sufficient to fix the Darwin
> issues, because darwin not only tries to stat() the entries, it also
> tries to read a special file in the subdir! Someone would have to
> check under what circumstances the Finder will try to read the
> subdir-special file so we can work around that, too.

There is one case where the Finder will not try to access a
subdirectory or even stat() it, and that is when it is actually a
SYMLINK to a directory with the sticky bit set on the symlink.  On the
OS X native filesystems (HFS and UFS), symlinks always have the same
permissions as the containing directory, so this means setting the
sticky bit on the directory where the symlink resides.

I can confirm that setting the sticky bit on a directory full of
symlinks into NFS automounted space avoids the mount storm you would
otherwise get when browsing that directory in the Finder.

This behavior is described in some Apple document, but I do not
remember which one.  I do remember that there was no mention of any
other way to prevent the Finder from looking inside a directory when
you browse it.

In other words, this does not help for AFS.  But it does suggest that
someone at Apple thought about the problem at some point, so perhaps
they would be amenable to a suggestion for improvement.

I believe the reason they do this is to support their "bundle" model.
Instead of their classic data+resource fork representation for
applications, Apple is migrating to a "directory full of crap"
representation.  But they still want the application to appear as a
single object when you look at it in the Finder, so the Finder looks
inside each directory to see if it is "really" an application, so that
it can display the app's custom icon or whatever.

Apple is also moving away from the type/creator tagging for files.  I
vaguely recall reading somewhere that OS X applications are strongly
advised, perhaps even required, to name their directories and files
with proper extensions to indicate their types.  Maybe Apple could be
convinced to add an optional setting to the Finder to avoid descending
into a directory unless the name had a dot in it.  Or maybe someone
more familiar with both OS X and AFS can think of a better idea.

Anyway, my point is that it might be profitable to figure out an
approach which the Finder could use without compromising Apple's
design goals, and then suggesting that approach to Apple.  Unlike some
other OS vendors, they have been known to listen to their user
community on occasion.

 - Pat