[comp.sys.amiga.tech] Alternate directory structures.

jms@doctor.Tymnet.COM (Joe Smith) (05/18/89)

In article <1989May12.183725.25380@ziebmef.uucp> mcp@ziebmef.UUCP (Marc Plumb) writes:
>	-Colin Plumb
>P.S. Does anyone have any ideas about directory formats?  I'm hovering in
>the vicinity of 24 bytes for an empty file with a single-character name and
>no comment, so I can promise cheap files, but whether to use an Amiga-style
>directory that's a lot of pointers to file headers or a CP/M-style
>directory that's basically an array of file headers proper is still an
>open question.  Then there's the Mac HFS scheme... does anyone know any
>other directory schemes?

Well, TOPS-10 has a directory structure that allows very fast directory
scanning, by keeping only the name and a single pointer in the directory.
All directory entries are 2 words long (each word is 36 bits and is capable
of storing 6 characters each).  The first word is the file name (6 characters).
The left half of the second word is the file extension (3 characters).  The
right half of the second word is the CFP (Compressed File Pointer).
Converting the 18-bit CFP into a logical block number is a simple algorithm
whose parameters can be different on each volume.

Checking for the existance of a file is straight forward: do a sequential
read on the directory.  Unlike CP/M and MS-DOS, you don't have to read in
and skip over all that file allocation info while searching for names.
(MS-DOS is really inefficient - 50% of each directory entry is unused.)
Getting a list of the names of all files in a directory is also easy.

However, programs on TOPS-10 are written with the understanding that there
are two distinct OS calls.  1) "Get me the next 64 names from the diretory"
and 2) "Tell me everything you know about one file".  That is, while
scanning the directory, the program gets a list of names only.  If it wants
to know the file's size, creation date, comment, etc, it has to issue a
separate system call to get that information.  This is no "Examine Next" in
the OS.

I feel that AmigaDOS needs to have a new function that will return the
next name (or group of names) in a directory WITHOUT all the other stuff
that's in the FIB.  The information that ExNext provides comes at no
extra cost from the OFS and the FFS, but may require a lot of overhead
on NFS or future file systems.  We need a filesystem independent way of
getting a list of the names of the files in a directory, and it needs to
be an integral part of the OS.  If AmigaDOS had come with such a function,
Collin wouldn't have a problem separting the file comment from the file name.

			Joe

P.S. If you're interested, I can post a description of the TOPS-20 directory
structure.  It can do thing like store ten 40-character names in only 60+ bytes
if the names differ only in the last character, and the entire directory is
stored on disk in alphabetic order.

-- 
Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@tymix.tymnet.com
McDonnell Douglas FSCO  | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-D21    | PDP-10 support: My car's license plate is "POPJ P,"
San Jose, CA 95161-9019 | narrator.device: "I didn't say that, my Amiga did!"