Summary
Surface !:apple TYPE/CREATOR directive metadata in the AST and evaluation output. magic(5) defines !:apple for Mac OS Classic-style four-character type and creator codes; libmagic emits them in detailed output and exposes them through API consumers.
Current State (after #51 work)
After #51 lands !:mime and !:ext directive evaluation, !:apple will remain the only commonly-used !: directive that is parsed-as-known-but-unimplemented in src/parser/preprocessing.rs (see KNOWN_UNIMPLEMENTED_DIRECTIVES). Lines beginning with !:apple parse without warning so magic files load cleanly, but the eight-character TTTTCCCC (4-byte type + 4-byte creator) payload is discarded.
Why Low Priority
!:apple appears in only a handful of GNU file magic entries (mostly classic Mac formats like ResEdit, AppleSingle/Double, classic Mac binaries).
- No corpus fixtures in
third_party/tests/ exercise it today.
- Modern macOS uses extended attributes and UTIs rather than HFS type/creator codes.
Acceptance Criteria
Out of Scope
- HFS attribute reading from the underlying filesystem —
!:apple is a magic-rule annotation, not a filesystem probe.
- UTI / extended-attribute integration — separate concern.
Refs
Summary
Surface
!:apple TYPE/CREATORdirective metadata in the AST and evaluation output. magic(5) defines!:applefor Mac OS Classic-style four-character type and creator codes; libmagic emits them in detailed output and exposes them through API consumers.Current State (after #51 work)
After #51 lands
!:mimeand!:extdirective evaluation,!:applewill remain the only commonly-used!:directive that is parsed-as-known-but-unimplemented insrc/parser/preprocessing.rs(seeKNOWN_UNIMPLEMENTED_DIRECTIVES). Lines beginning with!:appleparse without warning so magic files load cleanly, but the eight-characterTTTTCCCC(4-byte type + 4-byte creator) payload is discarded.Why Low Priority
!:appleappears in only a handful of GNUfilemagic entries (mostly classic Mac formats like ResEdit, AppleSingle/Double, classic Mac binaries).third_party/tests/exercise it today.Acceptance Criteria
!:apple TTTTCCCCand attaches the 8-character payload to the preceding ruleapple_type(4 chars) andapple_creator(4 chars) onMagicRule(or via aDirectivesstruct alongsidemime_type/extensionsadded in Evaluator: ZIP content inspection for compound document detection #51)EvaluationResultand JSON output!:applepaired with a buffer that triggers it)Out of Scope
!:appleis a magic-rule annotation, not a filesystem probe.Refs
src/parser/preprocessing.rsKNOWN_UNIMPLEMENTED_DIRECTIVESarrayapprentice.cdirective parser