分析ZIP文件的属性


17

我有一个ZIP文件,我想确定它的压缩方式(特定算法,用于应用该算法的属性,等等)。我怎样才能做到这一点?

Answers:


16

zipinfo(来自InfoZIP)将告诉您很多有关文件的信息。

的示例输出zipinfo -v(使用“ verbose”选项-v):

Archive:  /tmp/test.zip
There is no zipfile comment.

End-of-central-directory record:
-------------------------------

  Zip archive file size:                     22341 (0000000000005745h)
  Actual end-cent-dir record offset:         22319 (000000000000572Fh)
  Expected end-cent-dir record offset:       22319 (000000000000572Fh)
  (based on the length of the central directory and its expected offset)

  This zipfile constitutes the sole disk of a single-part archive; its
  central directory contains 1 entry.
  The central directory is 88 (0000000000000058h) bytes long,
  and its (expected) offset in bytes from the beginning of the zipfile
  is 22231 (00000000000056D7h).


Central directory entry #1:
---------------------------

  tmp/bookmarks.html

  offset of local header from start of archive:   0
                                                  (0000000000000000h) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   3.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2010 Feb 20 16:22:48
  file last modified on (UT extra field modtime): 2010 Feb 20 16:22:47 local
  file last modified on (UT extra field modtime): 2010 Feb 20 15:22:47 UTC
  32-bit CRC value (hex):                         3e84c75c
  compressed size:                                22155 bytes
  uncompressed size:                              76774 bytes
  length of filename:                             18 characters
  length of extra field:                          24 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             text
  Unix file attributes (100600 octal):            -rw-------
  MS-DOS file attributes (00 hex):                none

  The central-directory extra field contains:
  - A subfield with ID 0x5455 (universal time) and 5 data bytes.
    The local extra field has UTC/GMT modification/access times.
  - A subfield with ID 0x7875 (Unix UID/GID (any size)) and 11 data bytes:
    01 04 e8 03 00 00 04 e8 03 00 00.

  There is no file comment.

如果这还不够,请说明您需要哪些信息。


请注意,zipinfo功能实际上是unzip程序的一部分(两个二进制文件通常是相同的,或彼此链接)。您可以调用unzip -Z以获取zipinfo的功能。因此,如果您的安装中不应包含zipinfo二进制文件,则可以使用二进制文件unzip -Z


这看起来像我所需要的,但是InfoZip的镜像似乎关闭了,只有sourceforge上的源可用...
RCIX 2010年

好的,我知道了。我首先遵循了他们的FTP指令(稍作修改),但是随后我发现您可以从ftp.info-zip.org/pub/infozip/win32中获取所需的内容
RCIX

抱歉,我仍然需要帮助:zipinfo不会出现在我下载的档案中:(
RCIX 2010年

@RCIX:对不起,不知道在哪里可以获取Windows二进制文件。我使用Linux,它是所有发行版的一部分:-)。只需发布一个新问题以询问有关Windows二进制文件的问题。
sleske 2010年

@ RCIX,@ sleske:似乎zipinfo已合并到unzip中。下载unz*xn-x64.exe和使用unzip.exe -Zv FILENAME.zip
Ivan Chau

11

如info-zip档案文档中所述,该zipinfo命令实际上可以通过使用Windows命令运行unzip -Z

使用以下命令创建“ zipinfo.bat”批处理文件:

unzip.exe -Zsvh %1

并且您已经zipinfo在Windows上运行。


1
此命令也适用于CentOS / Linux,显然是在删除.exe之后
Aditya Kumar Pandey 2013年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.