Hashed file types

A hashed file is one operating system file. TAFC PB201214 creates four types of them; CREATE-FILE takes the type as TYPE=J4 and so on, and rejects J2 and J5. The first 8 bytes of a file tell its type.

TypeFirst 8 bytesFile offsetsNotes
J4JBC__HS48 bytesthe default type; a fixed number of groups
JRJBC__HSR8 bytes"resilient"; grows and splits by itself, needs no resizing
J3JBC__HS34 bytesthe type before J4; 1024-byte blocks
JPJBC__HSP8 bytesJ3 with 8-byte offsets and 4096-byte blocks

A dictionary (the file whose name ends with ]D) is a hashed file of the same kind as a data file. A UD file is not a hashed file: it is a folder with one operating system file for each record.

The four types share these rules:

The chapters that follow describe each type as TAFC PB201214 writes it on x86-64 Linux. The descriptions were checked against files made by TAFC under scripted writes, deletes and clears: a reader built from them lists every such file in the order of SELECT, and for J4 and JR a writer built from them produces the same bytes as TAFC. Record locks, encrypted files and secondary indexes are not described.

See Reading hashed files with jfiles for a command that reads all four types.

The jBC/jBASE data files explorer shows a file of any of the four types in the browser: a map of its frames, a block diagram of the type, every field of a frame over its bytes, and the path of a key lookup from the hash to the record. It offers files made by TAFC as samples and can open a file of your own.