help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jar files won't open in emacs 27.1 on debian 11.6 "bullseye"


From: Yuri Khan
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

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]