GizStackGizStack
View .mdOpen in ChatGPTOpen in Claude

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.

gizlang
import * as Iso from "gizlang/iso";

Types

File

gizlang
type File = { name: string; data: bytes; }

A file in the root of a disc: its name and bytes.

  • name: string
  • data: bytes

Entry

gizlang
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: string
  • at: i64
  • size: i64

Functions

image

gizlang
function image(volume: string, files: Vec<File>): bytes

A disc named VOLUME with FILES in its root, in their order, under both its primary and its Joliet tree.

Effects: fail, alloc.

files

gizlang
function files(disc: Stream): Vec<Entry> throws IoError

The files of DISC, every folder walked.

Effects: fail, io, alloc.

extract

gizlang
function extract(image: string, member: string, out: string): string

Copy 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.