Documentation
¶
Overview ¶
Command unarc extracts the archives in a directory, each into its own subdirectory, and never deletes the archive it read.
It exists because the shell cannot reliably address the files it is pointed at. On macOS a filename holding an accented character is stored DECOMPOSED (e + U+0300), and a name typed or quoted in composed form does not match it:
zipinfo: cannot find or open .../Logo IP Paris 6 e<U+0301>coles vertical web.zip
Three of sixty-five archives failed that way under a shell loop. Reading the directory with os.ReadDir hands over the exact bytes, with no quoting and no normalisation in between, so the question does not arise.
⛔ AN ARCHIVE'S NAMES ARE A TRUST BOUNDARY. filepath.Join neutralises a leading slash and does NOT neutralise "..", so every entry is checked against the destination after cleaning. An entry that escapes is REFUSED and named, not silently stripped: a stripped path writes a file somewhere the caller did not ask for, under a name that no longer says where it came from.
⛔ IT SAYS WHAT IT CANNOT DO. 7z, rar and xz need a decompressor this module does not carry, so those are reported as needing an external tool rather than counted as skipped -- a count that mixes "already done" with "cannot do" reads as success.