目前,onedrive生成的压缩文件被破坏到大多数软件。
正如我们在这里看到的,解决方案是使用十六进制编辑器。因为我有很多大文件,所以我想要bash脚本solution...is吗?
这是一个免费的测试文件:
发布于 2020-05-30 23:16:26
问题中的链接微软OneDrive是否导出损坏的大型ZIP文件?中提到的问题是OneDrive大于4Gig创建的文件在ZIP64 End Central Directory Locator中有一个无效的Total Number of Disks字段的问题。这个字段中的值应该是1,但是OneDrive (似乎是)将其设置为0。这使得使用标准解压缩实用程序处理这些文件变得困难/不可能。
对其中一个文件运行unzip会产生如下输出
$ unzip -l onedrive-zip-test-zeros.zip
Archive: onedrive-zip-test-zeros.zip
warning [onedrive-zip-test-zeros.zip]: 1073742329 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [onedrive-zip-test-zeros.zip]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)原始问题中的链接显示了如何使用十六进制文件编辑器手动修复该问题。或者,请参阅Fix-OneDrive-Zip以获得修复这些OneDrive压缩文件的脚本。如果值被错误地设置为0,那么它所做的就是将值设置为1。
用法是
fix-onedrive-zip file1.zip 在这种情况下
$./fix-onedrive-zip onedrive-zip-test-zeros.zip
Checking 'onedrive-zip-test-zeros.zip'
Updated 'onedrive-zip-test-zeros.zip'并且可以读取查看zip文件。
$ unzip -l onedrive-zip-test-zeros.zip
Archive: onedrive-zip-test-zeros.zip
Length Date Time Name
--------- ---------- ----- ----
1073741824 2020-03-18 14:48 onedrive-zip-test-zeros/file01.dat
1073741824 2020-03-18 14:51 onedrive-zip-test-zeros/file02.dat
1073741824 2020-03-18 14:54 onedrive-zip-test-zeros/file03.dat
1073741824 2020-03-18 14:57 onedrive-zip-test-zeros/file04.dat
1073741824 2020-03-18 15:01 onedrive-zip-test-zeros/file05.dat
--------- -------
5368709120 5 fileshttps://unix.stackexchange.com/questions/589925
复制相似问题