HCOPY(1)

πŸ’– HCOPY(1) πŸ’–

okay bestie, this is hcopy from the General Commands Manual section of your friendly neighbourhood HFSUTILS collection, and she is that girl when it comes to shuffling files between an HFS volume and UNIX. sit down, hydrate, let's go 🫢


✨ NAME ✨

hcopy β€” copy files from or to an HFS volume


🌸 SYNOPSIS 🌸

hcopy [-m|-b|-t|-r|-a] source-path [...]  target-path

πŸ’… DESCRIPTION πŸ’…

so basically hcopy transfers files from an HFS volume to UNIX, or the other way around. the named source files get copied to the named destination target, and here's the thing β€” if you're copying multiple files, that target must be a directory. no cap.

copies are performed using a translation mode, and it has to be one of these five. pick your fighter:

  • -m β€” MacBinary II: a super popular format for binary file transfer. Both forks of the Macintosh file are preserved. this is the recommended mode for transferring arbitrary Macintosh files, so if you don't know what you want, this is the one. πŸ’…
  • -b β€” BinHex: an alternative format for ASCII file transfer. Both forks of the Macintosh file are preserved.
  • -t β€” Text: performs end-of-line translation. only the data fork of the Macintosh file is copied.
  • -r β€” Raw Data: performs no translation at all. only the data fork of the Macintosh file is copied.
  • -a β€” Automatic: a mode will be chosen automatically for each file based on a set of predefined heuristics. the algorithm is doing the thinking so you don't have to, periodt.
if no mode is specified, -a is assumed. she's the default, she's the main character.

and now the cute part ✨ β€” if a UNIX source pathname is specified as a single dash (-), hcopy will copy from standard input to the HFS destination. likewise, a single dash used as a UNIX destination pathname will cause hcopy to copy the HFS source to standard output. pipes? we love her. πŸ¦‹


πŸŽ€ NOTES πŸŽ€

listen, copied files may have their filenames altered during translation. for example, an appropriate file extension may be added or removed, and certain other characters may also be transliterated. it's not a bug, it's a glow-up, but like... be aware. 😭

the destination target must not be ambiguous β€” meaning it has to be obvious whether the target is on the UNIX filesystem or on an HFS volume. no vibe-checking, no guessing.

as a rule, HFS targets must contain at least one colon (:), usually as the beginning of a relative pathname, or by itself to represent the current working directory.

to make a UNIX target unambiguous, either:

  1. use an absolute pathname, or
  2. precede a relative pathname with a dot and slash (./).

that's it. that's the whole trick. iykyk πŸ’œ


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Robert Leslie <rob@mars.org>


that's the whole page bestie, go forth and copy responsibly 🧚✨

this absolute icon of a manpage came to you courtesy of HFSUTILS, dated 13-Jan-1997 β€” yes she's vintage, yes she still ate, we stan a classic πŸ’–πŸŒΈπŸ’