[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 32MB is size???



mspangler <mspangler@gemsi.com> wrote:

> Note that the maximum file size is 16 megabytes for truly obscure
> reasons involving the number of directory blocks available. See the
> book "Beneath Apple prodos" for details. 

The limit on file size is due to the size of the "file size" field in
the directory: three bytes, so the maximum file size is 2^24-1 =
16,777,215 bytes, which is one byte less than 16 MB.

If this field was larger, then the number of levels of index blocks used
by a file would limit the maximum file size to 32 MB: two levels of
index, with 256 entries per index (2 bytes per entry), referencing 256 *
256 = 65536 blocks * 512 bytes per block = 32 MB. Adding a third level
of index would multiply this by 256 again (8 GB).

The number of directory blocks limits the total number of files in the
root directory of a standard ProDOS volume to 51 (13 files per block, 4
blocks, less one entry for the directory header). Subdirectories don't
have this limit.

Some non-standard volumes use a different number of blocks in the root
directory, e.g. /RAM only has one block, which means that it can only
fit 12 files in its root directory. This was also used on AppleWorks
program disks in order to squeeze a little more space for storing the
application, as it consisted of a small number of relatively large
files.

-- 
David Empson
dempson@actrix.gen.nz