Directory blocks
A directory is a chain of blocks. Bytes 0–1 of a block are the number of the previous block (0 in the first), bytes 2–3 the next (0 in the last); then come 13 entries of 39 bytes (bytes 4–510) and one unused byte. The volume directory's first block is block 2 and the chain usually runs 2, 3, 4, 5. The first entry of the first block is the header; the other entries are files and subdirectories. Two-byte and three-byte numbers are low byte first.
The headers
| Offset in the entry | Size | Volume header | Subdirectory header |
|---|---|---|---|
$00 | 1 | Storage type $F in the high nibble, name length in the low | Storage type $E, name length |
$01–$0F | 15 | The name, without the slash | |
$10–$17 | 8 | Reserved | |
$18–$1B | 4 | Creation date and time | |
$1C | 1 | Version of ProDOS that made it | |
$1D | 1 | Minimum version that can use it | |
$1E | 1 | Access | |
$1F | 1 | Entry length: 39 | |
$20 | 1 | Entries a block: 13 | |
$21–$22 | 2 | Number of active entries | |
$23–$24 | 2 | Block of the bitmap | Block of the parent directory |
$25–$26 | 2 | Total blocks of the volume | $25 entry number in the parent block; $26 entry length (39) |
The real /UTILITIES volume: entry length 39, 13 a block, 10 files, bitmap block 6, 1,600 blocks, created 1990-08-23 10:55, version byte 5, minimum version 0, directory chain 2, 3, 4, 5. A block count in the header that disagrees with the size of the image is reported.
A file or subdirectory entry
| Offset | Size | Meaning |
|---|---|---|
$00 | 1 | Storage type (high nibble) and name length (low). A first byte of $00 is an empty entry, a storage type of 0 with a name a deleted one |
$01–$0F | 15 | File name: letters, digits and periods, the high bit clear |
$10 | 1 | File type |
$11–$12 | 2 | Key pointer: the block that starts the file |
$13–$14 | 2 | Blocks used, index blocks included |
$15–$17 | 3 | End of file: the length in bytes |
$18–$1B | 4 | Creation date and time |
$1C | 1 | Version of ProDOS that created it |
$1D | 1 | Minimum version |
$1E | 1 | Access |
$1F–$20 | 2 | Auxiliary type |
$21–$24 | 4 | Date and time of the last change |
$25–$26 | 2 | The key block of the directory this entry is in |
Storage types
| Value | Meaning |
|---|---|
0 | Deleted |
1 | Seedling: the key block is the file's only block |
2 | Sapling: the key block is an index of up to 256 blocks |
3 | Tree: the key block is an index of up to 128 index blocks |
4 | Pascal area |
5 | Extended file (GS/OS): two forks |
D | Subdirectory: the key block starts its chain |
E, F | Subdirectory header, volume directory header |
File types
The viewer names these; any other value is shown as $xx (a longer list of file and auxiliary types is on the ProDOS file types page of the AppleDouble reference). TXT $04 text (aux: the record length of a random-access file), BIN $06 binary (aux: load address), DIR $0F directory, ADB $19, AWP $1A, ASP $1B AppleWorks database, word processor and spreadsheet, PAS $EF Pascal area, CMD $F0 ProDOS command, $F1–$F8 user types, INT $FA Integer BASIC, IVR $FB its variables, BAS $FC Applesoft (aux: $0801), VAR $FD its variables, REL $FE relocatable code, SYS $FF system file (loads at $2000), and the GS/OS types $B0–$BB (source, object, library, application, runtime library, shell script, initialisation files, desk accessories, tool, driver), $C0 $C1 (Super Hi-Res paint and picture) and $C8 (font). BAS, INT, BIN and SYS are read by the viewer; the others open as bytes.
Access
Bit 7 may be destroyed, bit 6 renamed, bit 5 "backup needed" (the file has changed since it was last backed up), bit 1 written, bit 0 read. The viewer writes them as five letters, R W B N D, with a dash for a clear bit. The real utilities disk has RWBND on every file; a locked file has only R.
Dates and times
Four bytes: a date word, then the minute and the hour. The date word, low byte first, is year × 512 + month × 32 + day (the year in the top 7 bits, the month in 4, the day in 5). The time is the minute (0–59) and then the hour (0–23). All zero means no date. The year is stored as two digits (0 to 99). This viewer reads 0–39 as 2000–2039 and 40–99 as 1940–1999; the real disks on this Mac (1987–1990) all fall in the second range, and which century a given year belongs to is a convention of the program that wrote it.