Expand description
Fork-preserving single-file export, shared by the browse view’s “Extract” and Commander’s copy/export-to-host.
Reads a file’s data fork (read_file) and resource fork
(write_resource_fork_to) off any Filesystem and writes it into a host
directory in the chosen ResourceForkMode:
- MacBinary — single
.bincarrying both forks (only when a resource fork is present; otherwise falls through to a plain data-fork write). - BinHex — single
.hqxtext file (always applicable; carries Finder info even with no resource fork). - AppleDouble — data fork under the plain name + a
._namesidecar (emitted whenever there’s a resource fork or type/creator to preserve). - Native — data fork + the macOS
..namedfork/rsrcwrite (macOS only). - SeparateRsrc — data fork + a
name.rsrcsidecar. - DataForkOnly — just the data fork.
This mirrors the browse view’s extract_entry per-file logic in one place
so Commander gets identical output, and it works over the remote wire too
(RemoteFilesystem implements write_resource_fork_to via the daemon’s
resource-fork read op).
Structs§
- Fork
Export Options - Choices
export_file_with_fork_optsadds toexport_file_with_fork.
Functions§
- export_
file_ with_ fork - Export one FILE
entryintodest_dirunder the base nameout_name(already sanitized / suffixed by the caller — e.g. the browse view appends a ProDOS#TTAAAAsuffix), usingmode. Returns the number of bytes written (data + resource) for progress accounting. The caller handles directories (create + recurse). Usesafe_namefor the default sanitized name. - export_
file_ with_ fork_ opts export_file_with_forkwith itsForkExportOptionsspelled out.- primary_
output_ path - The host path
export_file_with_forkwritesentry’s data to undermode, so a caller can see a collision before anything is overwritten. - safe_
name - The default sanitized host filename for
entry(no ProDOS type suffix). Callers with no special naming needs pass this asout_name.