Skip to main content

Module resource_fork

Module resource_fork 

Source
Expand description

Resource fork serialization for HFS/HFS+ file extraction.

Supports AppleDouble (._prefix sidecar), MacBinary III (.bin wrapper), and separate .rsrc sidecar files.

Structs§

ImportedResourceFork
Metadata extracted from a resource fork container (AppleDouble, MacBinary, etc.).
MacFileDates
Mac file dates as raw seconds since the classic Mac epoch (1904-01-01) — the exact encoding MacBinary stores in its header and HFS/HFS+ record on disk. A field of 0 means “unknown”: MacBinary writes a zero date and AppleDouble omits the File Dates Info entry, so callers with no dates get byte-identical output to the pre-dates behavior.

Enums§

ResourceForkMode
How to handle resource forks during extraction.

Functions§

build_appledouble
Build an AppleDouble (version 2) sidecar file.
build_macbinary
Build a MacBinary III file containing both data and resource forks.
detect_resource_fork
Detect and read a resource fork associated with host_path by probing all supported formats in priority order:
is_resource_fork_sidecar
Check if a host file is a resource fork sidecar that should be skipped during import (because it will be consumed as part of its primary file).
mac_name_bytes
A Mac file name as the classic containers store it: Mac Roman, at most 63 bytes. One byte per character, so the cut never splits a character.
macbinary_crc16
CRC-16 used by MacBinary (CRC-16/XMODEM: CCITT polynomial 0x1021, init 0, no reflection, no final XOR). Computed over header bytes 0..124. Shared with macarchive::macbinary, the canonical full-fidelity parser.
parse_appledouble
Parse an AppleDouble file and extract the resource fork and Finder info.
parse_binhex_fork
Decode a BinHex 4.0 (.hqx) container into both forks plus Finder info.
parse_macbinary
Parse a MacBinary (II/III) file and extract both forks and Finder info.
sanitize_filename
Sanitize a filename for the host OS via the shared legalizer (Windows rules on Windows).