gizlang/iso
ISO 9660 discs (ECMA-119) with Joliet names, made whole in memory: a seed of answer files, scripts and drivers that an installer reads. Joliet keeps each name as given, in any case and length; the primary tree holds the same files under upper-case names for a reader without Joliet. A disc's files are read back by their Joliet names, else by their Rock Ridge names (NM, also through a continuation area), else by their ISO names in lower case without the version: an installer image of Linux carries Rock Ridge, one made for macOS Joliet.
import * as Iso from "gizlang/iso";Types
File
type File = { name: string; data: bytes; }A file in the root of a disc: its name and bytes.
name:stringdata:bytes
Entry
type Entry = { path: string; at: i64; size: i64; }A file on a disc: its path (folders by "/"), its first byte's offset in the disc and its size.
path:stringat:i64size:i64
Functions
image
function image(volume: string, files: Vec<File>): bytesA disc named VOLUME with FILES in its root, in their order, under both its primary and its Joliet tree.
Effects: fail, alloc.
files
function files(disc: Stream): Vec<Entry> throws IoErrorThe files of DISC, every folder walked.
Effects: fail, io, alloc.
extract
function extract(image: string, member: string, out: string): stringCopy the file MEMBER (a path such as boot/vmlinuz-virt) of the disc image at IMAGE to the new file OUT. "" on
success, else why not.
Effects: fail, read, io, alloc.