AppleShare 2.01: Maximum Number Of Files


With AppleShare 1.1, volumes should contain no more than 8,000 files due to
the PDS problems.

The PDS problem was fixed in version 2.01 of AppleShare and, thereby,
removed the recommended 8,000-file limitation. AppleShare 2.01 is now
limited by the number of files allowed under HFS.

It is sometimes noted that HFS is limited to 64,000 files per volume. This
is not strictly correct, though it may be true in practice.

A count of the total number of files and directories on the volume is
maintained, as a LongInt, in the MDB (block 2). Directory IDs are also
LongInts. This limits the number of files and folders on the volume to 2^32-1
(roughly 4.3 billion). That many folders could be created as long as there's
room on the volume to hold the expanding catalog B*-Tree.

Because each file occupies at least one allocation block, all of the--at
most--65,536 allocation blocks (also numbered by Integers) will be
allocated just before that many files are written on the volume, so the
limit of 64,000 files is close to the practical limit.

There is another limitation imposed: a directory's valence is an Integer and,
furthermore, on GetCatInfo requests, any negative number in the ioFlIndex
field is interpreted as a request for information on the directory itself. So,
while HFS allows the creation of up to 65,536 files in each directory, all of
which can be accessed by name, only 32,767 can be enumerated -- a real
limitation on folder contents. In practice, the user's patience will run
out well before this many items can be enumerated.

Finally, all computations on file sizes are performed using LongInts, so
there's no practical limit on the size of an individual file -- though the
actual limit is about two gigabytes.


Published Date: Feb 18, 2012