我有一个 3.5 GB 的 CSV 文件,需要以压缩的 10 MB 部分进行传输。但是,在完成压缩然后拆分 zip 的过程后,使用 、 和 重新组合zip -s-
zipzip -s 0
不起作用zip -FF
。
$ du -h mycsv.csv
3.1G mycsv.csv
首先,我以最大压缩创建一个 zip 文件:
$ zip -9 maximum.zip mycsv.csv
adding: mycsv.csv (deflated 92%)
$ du -h maximum.zip
254M maximum.zip
然后我使用该zip -s 10m
命令将 zip 拆分为许多 (26) 个 10 mb zip 部分
zip -s 10m maximum.zip --out maxsplit.zip
copying: mycsv.csv
然后我使用zip -s-
命令将文件重新组合成一个 zip
$ zip -s- maxsplit.zip --out maxunsplit.zip
copying: mycsv.csv
然而,该文件只是预期大小的一小部分!
$ du -h maxunsplit.zip
21M maxunsplit.zip
使用替代命令zip -s 0
也失败
$ zip -s 0 maxsplit.zip --out maxunsplit0.zip
copying: mycsv.csv
$ du -h maxunsplit0.zip
21M maxunsplit0.zip
另一个替代命令zip -FF
也失败了,
$ zip -FF maxsplit.zip --out maxunsplitFF.zip
Fix archive (-FF) - salvage what can
Found end record (EOCDR) - says expect 26 splits
Scanning for entries...
Found spanning marker - expected as this is split (multi-disk) archive...
copying: mycsv.csv (265820618 bytes)
zip warning: entry truncated: mycsv.csv
zip warning: expected compressed/stored size 265820618, actual 20971443
zip warning: unexpected signature 50 4b 0d 0d on disk 2 at 2711323
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0b 08 on disk 2 at 8427139
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 08 03 on disk 3 at 4921506
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0c 06 on disk 6 at 2338084
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 04 02 on disk 6 at 3998893
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0c 01 on disk 6 at 6941468
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0d 01 on disk 11 at 6509060
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 01 0b on disk 13 at 6769524
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 03 09 on disk 16 at 3164347
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0e 02 on disk 16 at 5817195
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 03 06 on disk 16 at 7044780
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0d 07 on disk 17 at 9182115
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 05 03 on disk 19 at 3063961
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 00 02 on disk 19 at 10170897
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0b 01 on disk 20 at 1420190
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 02 05 on disk 22 at 1010931
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 07 05 on disk 22 at 1918087
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 07 0b on disk 23 at 1507450
zip warning: skipping this signature...
zip warning: unexpected signature 50 4b 0a 0a on disk 23 at 10456363
zip warning: skipping this signature...
Central Directory found...
no local entry: mycsv.csv
EOCDR found (26 3676780)...
zip warning: zip file empty
最后一些错误消息,虽然我不明白它们的意思!?
Zip 和 Linux 版本:
$ zip --version
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
$ uname -rosv
Linux 5.4.0-56-generic #62~18.04.1-Ubuntu GNU/Linux