Subject: Re: [netatalk-admins] Alpha-sorted directory listings?

From: [email-masked] (Bob Smith, Hammett & Edison, Inc.)
Date: Mon, 20 Jul 1998 14:26:08 -0700

On Mon, Jul 20, 1998, 13:23:05 Chris Thorman wrote:

>>I believe Netatalk sorts according unix standards where all upper-case
>>charecter come before all lower-case charecters .
>
>Doesn't seem to be the case; I'm getting an order that seems to be
>creation-time based.  This is using an ext2 file system on Linux Red Hat
>5.0.
>
>Anybody else using a utility such as PopupFolder which displays the
>unsorted output of a PBHGetCatInfo?

As I recall, afpd doesn't do any sorting at all, it uses opendir()/readdir()
and returns the entries to the Mac in the order they exist in the directory. 
No Un*x filesystem that I know of does any sorting at the directory level
(certainly ext2 doesn't), so the order will be more or less by time of
creation for a fairly new directory, however one that has had lots of
deletions and creations will be in increasingly random order.  This is
fundamentally different than an HFS volume (or HFS-based AppleShare server
volume) because HFS implicitly stores the volume catalog in alpha sequence.

To fix this the directory scan code in afpd would have to be re-written to
store and then sort the directory information, I'm sure it is possible but it
probably isn't trivial.

Hope this helps!

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