[
https://issues.apache.org/jira/browse/COMPRESS-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16910748#comment-16910748
]
Stefan Bodewig commented on COMPRESS-478:
-----------------------------------------
I'll also send an additional email to the list later.
After spending two hours inside of a hex editor I was completely convinced
there was no file name inside of the archive. And then it dawned on me. The
file name the 7z command line tools uses is the name of the archive with
{{.7z}} stripped. I renamed and the archive and yes, the extracted file has a
different name.
So there seems to be a heuristic in 7z somewhat like "if there is only a single
file inside of the archive and it has no explicitly specified name, then derive
the name from the archive name". I've played around with file names and if the
archive name doesn't end with {{.7z}} then the CLI appends a {{~}} to the
archive name for the file name.
Rather than guessing what the exact heuristics are I hope to find the code for
it inside of 7zip's code base and implement similar heuristics inside of
{{SevenZFile}}.
> compress should handle ".zim" files as well (especially customized for
> wikipedia pages)
> ---------------------------------------------------------------------------------------
>
> Key: COMPRESS-478
> URL: https://issues.apache.org/jira/browse/COMPRESS-478
> Project: Commons Compress
> Issue Type: Wish
> Components: Compressors
> Environment: $ uname -a
> Linux niggahme 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02)
> x86_64 GNU/Linux
> $ java -version
> openjdk version "1.8.0_171"
> OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-1~deb9u1-b11)
> OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
> $ javac -version
> javac 1.8.0_171
> $
> Reporter: Albretch Mueller
> Priority: Critical
> Fix For: 1.19
>
>
> Based on the discussion started on the mailing list:
> // __ no name listed for file contained in a 7z file?
>
> [https://lists.apache.org/thread.html/7283eb6ad046a4e4cac97761ece777daead2504081521f277b9ff3c3@%3Cuser.commons.apache.org%3E]
> There are discrepancies between the handling of the Linux 7z utilities and
> how apache.compress is handling them.
> Ideally one should be able to selectively access and decompress files in a
> tax ball as you do with zip and gzip files.
>
>
--
This message was sent by Atlassian Jira
(v8.3.2#803003)