如何解压损坏的 zip 文件?

如何解压损坏的 zip 文件?

我将一些 zip 文件压缩成另一个 zip 文件。后来,当我尝试提取它时,我收到以下消息:

End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.

我怎样才能解决这个问题?

答案1

zip工具提供了--fix(或-F)选项来尝试修复损坏的 zip 文件。对于损坏严重的存档,可以使用 选项-FF。因此,您可以使用以下命令从损坏的 zip 文件中恢复数据(参考):

zip -FF corrupted.zip --out new.zip

只能恢复未损坏的文件:某些文件可能丢失。

答案2

因为:

zip -FF corrupted.zip --out new.zip

以错误结束:

zip warning: no end of stream entry found: DCIM/Camera/VID_20230128_173302.mp4
    zip warning: rewinding and scanning for later entries

因此我跑了

zip -FF new.zip --out new2.zip

最后又以如下信息结尾:

Central Directory found...
EOCDR found ( 1 4156974377)...
    zip warning: unexpected signature 50 4b 0a 07 on disk 0 at 4195187925
    zip warning: skipping this signature...
    zip warning: unexpected signature 50 4b 09 04 on disk 0 at 4241474727
    zip warning: skipping this signature...
    zip warning: unexpected signature 50 4b 04 0a on disk 0 at 4248545602
    zip warning: skipping this signature...
    zip warning: unexpected signature 50 4b 07 08 on disk 0 at 4257152005
    zip warning: skipping this signature...
    zip warning: unexpected signature 50 4b 09 0c on disk 0 at 4270143948
    zip warning: skipping this signature...
    zip warning: unexpected signature 50 4b 09 03 on disk 0 at 4288941105
    zip warning: skipping this signature...

但这一次,可以打开档案并恢复文件。

相关内容