Expand description
Resource fork serialization for HFS/HFS+ file extraction.
Supports AppleDouble (._prefix sidecar), MacBinary III (.bin wrapper), and separate .rsrc sidecar files.
Structs§
- Imported
Resource Fork - Metadata extracted from a resource fork container (AppleDouble, MacBinary, etc.).
- MacFile
Dates - 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
0means “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§
- Resource
Fork Mode - 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_pathby 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).