Skip to main content

Module mac_alias

Module mac_alias 

Source
Expand description

Classic Mac alias resolution.

Parses the alis resource record stored in a file’s resource fork (the marker for aliases is kIsAlias/0x8000 in FInfo.fdFlags).

We extract just enough to show the user where an alias points:

  • Target filename (from the fixed portion at offset 50)
  • Volume name (from the fixed portion at offset 10)
  • Optional absolute path from tagged record 18 (UTF-8) or 2 (MacRoman)

We do not attempt to follow the alias; the target may no longer exist.

Constants§

IS_ALIAS_FLAG
Finder flag bit indicating the file is an alias.
RHAP_CREATOR
Creator code for classic HFS+ UNIX symlinks.
SLNK_TYPE
Type code for classic HFS+ UNIX symlinks.

Functions§

find_alis_in_resource_fork
Parse a resource fork and return the data bytes of the first alis resource, if any.
parse_alis_record
Parse an alis resource record and return a human-readable target string like "Volume:TargetName", or an absolute path when one is present.
resolve_alias_target
One-shot helper: given raw resource-fork bytes, return a display string for the alias target, or None if no alis resource is present / parseable.