ARCFS(5)
okay so hi bestie π you just opened ARCFS(5) β that's section 5, the File Formats Manual one β and it is literally all about the ArcFS archive file format for the RISC OS ArcFS filesystem. we are decoding bytes together today and it's gonna be iconic, no cap. π¦
β¨ NAME β¨
ArcFS β the archive file format for the RISC OS ArcFS filesystem. that's the whole vibe. π
π CONVENTIONS π
before we get into it, house rules bestie, so we're all speaking the same language:
- Strings are given in ASCII with C-style escapes. and there's no terminating byte present if it's not explicitly included β so don't go looking for one, she's not there. π
- Words are 32 bit little-endian numbers. words. thirty-two bits. little-endian. okay? okay.
- Half words are 16 bit little-endian numbers. half the word, all the endian. β¨
- This doc describes format version
0(for ArcFS minimum versions0.40and1.00) and version0a(for ArcFS minimum versions0.58and2.17). two eras, both iconic. π
π FORMAT π
the file is built like a lil sandwich, in this exact order:
- a file header
- a sequence of archive headers
- a sequence of compressed files
that's it. that's the whole structure. slay. π₯ͺ
π FILE HEADER π
the opening act. here's what's in it, field by field:
- File string signature β the string
"Archive"followed by a zero byte. like a lil name tag at a party. π - Header length β length of header info in bytes, one word, multiple of
36. yes, a multiple of 36, she does not do random numbers. - Data offset β offset, in bytes, into archive at which data starts, one word.
- Read-only version β minimum read-only version required, multiplied by
100, one word. - Read-write version β minimum readβwrite version required, multiplied by
100, one word. - Reserved β reserved for future use,
68bytes. she's just sitting there, holding space for the future. π«Ά
π ARCHIVE HEADER π
okay so the last header starts at 60+length of headers and ends at 96+length of headers. got that? write it down bestie. the format of each header goes like this:
- Info byte β the object information byte, shows the compression method used:
0x00β end of directory marker0x01β object has been deleted0x82β stored0x83β packed0x88β crunched0xFFβ compressed
- File name β file name,
11bytes. - Full length β original file length, or
0xFFFFFFFFfor a directory, one word. - Load address β load address of the file, or
0xFFFFFFddfor a directory, one word. - Exec address β exec address of the file, or
0xddddddddfor a directory, one word.
quick note bestie: the file load and execution address may contain a filetype and datestamp as normal. π
and directories can be date-stamped too! the number of centiseconds since the 1st January 1900 when the directory was created are given by &dddddddddd contained in the directory's load and execution addresses as shown above. she remembers her birthday. π
also, archives converted from spark(5) format using ArcConv will have the same full length, compressed length, load address and execute address as they had in the Spark archive. no glow-up, no downgrade, same energy. β¨
- Attributes β attributes of the file, one word. contains the number of bits compression for crunch and compress format files, and the least significant bytes contains the standard RISC OS information on file access.
- Compressed length β length of compressed data, or
0xFFFFFFFFfor a directory, one word. - Information word β the top bit (definitively) indicates whether the object is a file or a directory:
0for a file,1for a directory.- in the case of a file, the least significant 31 bits show the offset from the start of data at which the file data can be found.
- in the case of a directory, the least significant 31 bits show the offset from the start of headers (
96) at which the next object in this directory can be found, the following object being the first in the sub-directory.
that top bit is doing SO much heavy lifting honestly. π
π¦ FORMAT VERSION 0a π¦
this archive format is backwards compatible with versions 0.40 and 1.00, and the only difference is that there's a block of catalogue information immediately prior to the start of each file's data, as described below. she's the same girl, she just got a lil extra. π
note bestie: this information is there to aid the recovery of most files in the event of archive corruption, and it is not used by ArcFS. it's like a backup bestie who's just vibing in the background. π«Ά
also note:CompactandAutocompactin release versions1.09,2.02and2.11will compact out the catalogue information blocks, so try to avoid writing to new archives with old versions of ArcFS. seriously. don't do it. that's your recovery info getting deleted. π
here's what's in that block, in order:
- Marker β a marker to indicate the start of a file, the string
"FileData", not terminated. - Info byte β one byte, as above.
- Leaf name β the file name,
11bytes. - Full length β one word, as above.
- Load address β one word, as above.
- Exec address β one word, as above.
- Attributes β one word, as above.
π SEE ALSO π
go read these next, they're the friends of this page:
and that's the whole page bestie!! π this was ARCFS(5) from the File Formats Manual β you can find her in section 5 of your manual pages, and this is the version that lives in that manual right now. go forth and archive responsibly. mwah. πβ¨ππ¦π
π¦ where this page comes from
- debian bookworm: nspark 1.7.8B2+git20210317.cb30779-2 Β· nspark
- debian trixie: nspark 1.7.8B2+git20210317.cb30779-2 Β· nspark
- ubuntu jammy: nspark 1.7.8B2+git20210317.cb30779-2 Β· nspark
- ubuntu noble: nspark 1.7.8B2+git20210317.cb30779-2 Β· nspark
- ubuntu resolute: nspark 1.7.8B2+git20210317.cb30779-2.1 Β· nspark
- ubuntu stonking: nspark 1.7.8B2+git20210317.cb30779-2.1 Β· nspark
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms