Subj : Re: Unpack Cmd "%2" and paths (tar example) To : g00r00 From : Bj”rn Wiberg Date : Fri Aug 06 2021 12:54 am Hello again, g00r00! On 05 Aug 2021, Bj”rn Wiberg said the following... BW> Tested viewing, (D)ownloading file from inside archive (including some BW> "tricks" BW> there which appear to be handled correctly now) and also downloading a The only "bad" thing I noticed is that the automatic "basenaming" (stripping path info from the entered filename) of "%2" for the Unpack Cmd can make it hard to perform archive member (file) selection for certain archivers. For instance, tar requires the "correct" (full) path of a file within an archive to be entered when selecting files for extraction. For example: $ tar tf ../test2.tar atest2.txt test1.txt subdir/ subdir/btest2.txt subdir/test2.txt $ tar -xvf /tmp/test2.tar -C /tmp/bw2/ --xform='s,.*/,,' --overwrite -- "test2.txt" tar: test2.txt: Not found in archive tar: Exiting with failure status due to previous errors $ tar -xvf /tmp/test2.tar -C /tmp/bw2/ --xform='s,.*/,,' --overwrite -- "subdir/test2.txt" subdir/test2.txt One can enable wildcards, but it will be a "sloppy" match, selecting more than desired: $ tar -xvf /tmp/test2.tar -C /tmp/bw2/ --xform='s,.*/,,' --overwrite --wildcards -- "*test2.txt" atest2.txt subdir/btest2.txt subdir/test2.txt This will potentially leave a bunch of similarly named files from within the archive left over in the temp* directory, as only the file name entered will be deleted by Mystic... The --xform=... option does wonders, however, when it comes to junking paths for the extracted files (if one managed to extract any files). The result of the wildcard extraction above is: $ ls -1 atest2.txt btest2.txt test2.txt The tar example with the sloppy match (so far) in Mystic is: Extension ³ TAR OS ³ Linux Description ³ GNU tar Pack Cmd ³ { cd "$(dirname "%2")" && tar -c -f "%1" -- $(basename "%2"); } Unpack Cmd ³ tar -x -f "%1" -C "%3" --xform='s,.*/,,' --overwrite --wildcards -- "*%2" View Cmd ³ { tar -t -f "%1" -v --full-time -- >> "%3%2"; } Best regards Bj”rn --- Mystic BBS v1.12 A47 2021/08/05 (Linux/64) * Origin: Star Collision BBS, Uppsala, Sweden (2:201/137) .