Zip存档包含没有名称的文件,如何解压缩?

问题描述 投票:0回答:1

我有一个ZIP存档,里面有一些照片。问题是,我无法解压缩此存档中的所有文件。

解压缩命令:

unzip archive.zip
Archive:  archive.zip
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed

ZIP存档内的文件列表(每个文件没有名称...):

unzip -l archive.zip 
Archive:  archive.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
    61684  03-07-2019 10:01   
    55901  03-07-2019 10:01   
    71678  03-07-2019 10:01   
    69684  03-07-2019 10:01   
    57131  03-07-2019 10:01   
    95984  03-07-2019 10:01   
    69633  03-07-2019 10:01   
    73401  03-07-2019 10:01   
    79661  03-07-2019 10:01   
    53126  03-07-2019 10:01   
    68691  03-07-2019 10:01   
    66707  03-07-2019 10:01   
---------                     -------
   823281                     12 files

解压缩测试命令:

unzip -t archive.zip 
Archive:  archive.zip
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK

如果我尝试解压缩管道命令,那么我有一个JPEG文件,其中包含所有存档照片。

unzip -p archive.zip | cat > $(date +%s%3N).jpeg

请问有这样的解压缩档案的机会吗?


更新

在HEX编辑器中显示ZIP存档时,我看到存档文件没有设置名称。在图像是ZIP文件的末尾,它包含有关每个归档文件的信息。图像上的选定字节表示一个存档文件的信息容器.Information Bytes of one of archived file

zip unzip ziparchive
1个回答
0
投票

首先你在shell中的语言环境不应该是ASCII,我认为是简单的Linux用户。

locale

它可以是存档的编码。我想到UTF-16 / UTF-32大端,对于ASCII字母,前面的nul字节会占空字符串。

unzip -O UTF-16BE -l archive.zip
unzip -O UTF-16BE archive.zip

否则需要一些编程,要么修补名称,要么遍历条目并选择自己的名称来存储每个文件。 Java ZipInputStream会这样做。

我认为是这种情况,有人编程压缩目录但忘记设置条目的文件名。

© www.soinside.com 2019 - 2024. All rights reserved.