1 linux compression file-transfer
我不得不拆分这个 2.6 GB 的 zip 文件,以便通过慢速上行链路发送它。我这样做了:
split -b 879m BIGFILE.zip
Run Code Online (Sandbox Code Playgroud)
这创建了我上传到远程服务器的 xaa、xab 和 xac。传输完成后,我使用 md5sum 验证了这 3 个部分中的每一个(在我的本地系统和服务器上):
md5sum xaa
md5sum xab
md5sum xab
Run Code Online (Sandbox Code Playgroud)
所有 3 个哈希值都与我系统上的 3 个哈希值相同,因此传输进行得很顺利。现在,在远程系统上,当我这样做时:
cat xa* > BIGFILE.zip
Run Code Online (Sandbox Code Playgroud)
...然后我验证这个 BIGFILE.zip 的哈希值(在两个系统上):
md5sum BIGFILE.zip
Run Code Online (Sandbox Code Playgroud)
......他们两个都匹配。
现在是有趣的部分。当我尝试列出 zip 文件的内容时,出现错误:
unzip -l BIGFILE.zip
Run Code Online (Sandbox Code Playgroud)
我得到:
Archive: BIGFILE.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.
unzip: cannot find zipfile directory in one of BIGFILE.zip or
BIGFILE.zip.zip, and cannot find BIGFILE.zip.ZIP, period.
Run Code Online (Sandbox Code Playgroud)
这完全很奇怪。我在两个系统上使用相同版本的“解压缩”。当我在本地系统上使用“unzip -l”时,它可以工作。
谢谢你的帮助。JFA
相同的 MD5 哈希表明传输运行良好。
超过 2G 的文件大小听起来有点像指针大小问题——也许有问题的 zip 处理得不好?超过 (ca) 2G 将是 32 位的负数......你能在你压缩它的系统上解压缩文件吗?两个系统有区别吗?一个是 64 位,有问题的 32 位?两个系统上的文件系统是什么?你能找到另一个 zip 实用程序吗?
如果您有机会重新传输内容,您可能希望使用 tar.gz 或保持文件大小低于该值。gzip 压缩内容应该可以更好地处理这个问题。Zip 将内容(索引)存储在文件末尾。
编辑:是的,请看这里:
实际上,由于 UnZip 使用 fseek() 函数在存档内跳转,因此在许多系统上的实际限制可能是 2 GB。因为 fseek 的偏移参数通常是一个有符号的长整数,所以在 32 位系统上,UnZip 不会找到任何从存档开头开始超过 2 GB 的文件 [...]
归档时间: |
|
查看次数: |
2797 次 |
最近记录: |