Home
CBM
  ASCII-X
  BASIC
  C128
  D64plus
  Disk
    BAM
    Fast Load
    File
    Sector
    Block
    Directory
    Header
    Physics
    Track
  Escape Codes
  Hardware
  PCxface
  PETSCII
  Pet2asc
Futurama
IBM PC-AT
Contact
Games
Glossary
Hall of fame
Hall of shame
Miscellaneous
Privacy policy
Programming
Twisty puzzles
  Directory 

The directory is a series of blocks which contain 8 file entries each (some may be unused). Each file entry contains a variety of information and uses 30 bytes:

Offset in directory entry
01~23~1819~20212223~2728~29
File
Type
Main
Link
FilenameOther
Link
REL
size
GEOS
type
Date/Time
stamp
Size

Let's take a look at each of these parts.

  File type 

This byte specifies the CBM file type in the lower 6 bits:

ValueType
0DEL
1SEQ
2PRG
3USR
4REL
5CBM
6DIR

Bit 6 is set to indicate the file is "locked" (read-only). Bit 7 is set to indicate the file has been properly closed. A standard CBM directory listing will show a * by the file-type if it is not properly closed; these are known a "splat" files.

  Main Link 

This points to the starting track and sector (first block) of the main file data. For GEOS VLIR files, it points to the VLIR table.

  Filename 

A filename may be up to 16 characters (bytes) long. Unused characters are filled with a "shifted space" = PETSCII code 160.

  Other Link 

This points to the starting track and sector of either a REL file's side-sector table, or to the only block of a GEOS "info sector".

  REL Size 

For RELative files, this byte indicates the record length (2 to 254 bytes). For GEOS files, it indicates the 'file structure': 0 is sequential and 1 is VLIR..

  GEOS Type 

This byte indicates the type of GEOS file:

ValueType
0Non-GEOS
1BASIC program
2Assembler file
3Data file
4System file
5Desk Accessory
6Application
7Application data (user document)
8Font file
9Printer driver
10Input driver
11Disk driver
12System boot file
13Temporary file
14Auto-execute file

  GEOS Date & Time 

These five bytes are used by GEOS as a last-modified date/time stamp:

Offsets 23~27 in directory entry
2324252627
Year-1900MonthDayHourMinute

Notice the year is encoded as year - 1900. So byte 88 would appear for the year 1988 or byte 126 would appear for year 2026.

  Size 

This two-byte value (stored little-endian) indicates the size of all streams in blocks (multiples of 254 bytes rounded up). For example, if the file contained 1024 bytes, that would be 1024/254 = 4.0135... → 5 blocks.

For a standard PRG or SEQ file, use the number of blocks in the stream indicated by Main Link. For a GOES sequential-structure file, one would be added to account for the info block. For a REL file, you would add the number of blocks from Main Link to those from Other Link (other link typically has 1 to 6 blocks). For a GEOS VLIR file, one would need to add up each stream in the VLIR table, then add two: plus one for the VLIR table itself, and plus another one for the GEOS info block.


© Hydrophilic.net, 2026