我有两个文件,一个是用 zip 2.3.1 生成的,另一个是用 zip 3.0 生成的。两者都是同一目录的 zip。这是两个文件及其大小:
1.7G from-2.3.1.zip
1.7G from-3.0.zip
Run Code Online (Sandbox Code Playgroud)
我的计划是将我的系统转换为新的 zip,这样我就可以创建更大的 zip 文件,例如最大 3 GB 左右。
但是,我担心的是,当我使用稍旧版本的 unzip 解压缩这些文件时,当我尝试解压缩使用 zip 3.0 创建的 zip 时会出现错误。
$ unzip -t from-2.3.1.zip > /dev/null # NO Errors
$ unzip -t from-3.0.zip > /dev/null
warning [from-3.0.zip]: 76 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [from-3.0.zip]: reported length of central directory is
-76 bytes too long (Atari STZip zipfile? J.H.Holm ZIPSPLIT 1.1
zipfile?). Compensating...
error: expected central file header signature not found (file #67358).
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
$
Run Code Online (Sandbox Code Playgroud)
我担心的原因是,如果我转向 zip 3.0,我将迫使我的下游用户全部升级到较新版本的 unzip,例如,因为 unzip 6.0 可以无误地解压这两个文件。
这种异常并非在所有情况下都会发生,所以我不确定它的全部范围。
有什么建议?我是否以某种方式错误地构建了 zip 3.0?
谢谢。