From: Yuri Khan <yuri.v.khan@gmail.com>
To: Steinar Bang <sb@dod.no>
Cc: help-gnu-emacs@gnu.org
Subject: Re: jar files won't open in emacs 27.1 on debian 11.6 "bullseye"
Date: Mon, 3 Apr 2023 03:10:46 +0700 [thread overview]
Message-ID: <CAP_d_8UB+=X4_W7Z2xCn46dLDiKSK=a5FYLSNFAuX5AkSjmCNw@mail.gmail.com> (raw)
In-Reply-To: <87a5zqkt47.fsf@dod.no>
On Mon, 3 Apr 2023 at 02:00, Steinar Bang <sb@dod.no> wrote:
> Ok, archive-zip-summarize looks for the magic sequence "PK\005\006" or
> "PK\006\007" or "PK\006\006" or "PK\001\002".
>
> But what this jar file starts with, is "PK^c^d", which I think is
> "PK\003\004", which is non of the above.
>
> I.e. archive-zip-summarize doesn't recognize the magic number of these
> jar files.
ZIP archives are not defined by the magic number in the starting
bytes. It is valid to prepend anything to a ZIP archive. This is used
by self-extracting archives where the starting part is an executable.
The defining part of a ZIP archive is the End of central directory
record, magic number PK\x05\x06; it is optionally preceded by Zip64
extensions (PK\x06\x07 and PK\x06\x06), further preceded by Central
directory headers (PK\x01\x02). These are sufficient for displaying a
directory listing of the archive.
PK\x03\x04 is the signature for Local file header, which marks the
start of an actual compressed file’s data. So, indeed, a plain
unadorned non-empty ZIP archive will start with PK\x03\x04, but it is
not the magic number for ZIP archives and a conforming archive
processor should not scan specifically for that, at least until it is
asked to actually extract enclosed files.
See <https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT> for details.
next prev parent reply other threads:[~2023-04-02 20:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-02 6:15 jar files won't open in emacs 27.1 on debian 11.6 "bullseye" Steinar Bang
2023-04-02 7:03 ` Eli Zaretskii
2023-04-02 15:03 ` Steinar Bang
2023-04-02 15:12 ` Eli Zaretskii
2023-04-02 18:59 ` Steinar Bang
2023-04-02 19:23 ` Eli Zaretskii
2023-04-02 22:53 ` Steinar Bang
2023-04-03 6:35 ` Steinar Bang
2023-04-03 6:56 ` Steinar Bang
2023-04-03 7:43 ` Steinar Bang
2023-05-07 7:42 ` Steinar Bang
2023-04-02 20:10 ` Yuri Khan [this message]
2023-04-02 22:57 ` Steinar Bang
2023-04-02 8:35 ` Michael Albinus
2023-04-02 12:50 ` Steinar Bang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAP_d_8UB+=X4_W7Z2xCn46dLDiKSK=a5FYLSNFAuX5AkSjmCNw@mail.gmail.com' \
--to=yuri.v.khan@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=sb@dod.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.