gizlang/cpio
import * as Cpio from "gizlang/cpio";Types
Entry
type Entry = { name: string; mode: u64; major: u64; minor: u64; data: bytes; }One newc archive member. Mode includes its POSIX file type; major/minor name a character or block device. A symbolic link's data is its target, a path relative to its folder that stays in the tree; devices and directories have none.
name:stringmode:u64major:u64minor:u64data:bytes
Functions
newc
function newc(entries: Vec<Entry>, alignment: i64 = 4): bytes throws stringA deterministic newc cpio archive, including device metadata and the trailer. Paths are relative and cannot escape a destination tree. Each file's data starts at a multiple of ALIGNMENT bytes (a power of two, at least 4) from the archive's start: with the page size, a kernel can use the data in place.
Effects: fail, alloc.