Windows 10 中的一个大文件夹应该如何压缩,将其上传到GDrive,然后解压缩?

How should one zip a large folder in Windows 10, upload it to GDrive, then unzip it?

我有一个包含22个子目录的目录。总而言之,该目录的大小约为 750GB,我需要 GDrive 上的这些数据,以便我可以在 Google Colab 中使用它。显然上传这个需要一定的时间(特别是我的网速很慢)所以我想压缩它,上传它,然后在云中解压缩。 我正在使用 7zip 并使用 zip 格式和 "normal" 压缩级别压缩每个子目录。 (编辑:现在可以确认我得到了 7z 和 tar 格式的相同错误)。每个子目录最终大小在 14 到 20GB 之间。然后我上传它并尝试使用以下代码在 Google Colab 中解压缩它:

drive.mount('/content/gdrive/')
!apt-get install p7zip-full
!7za x "/content/gdrive/My Drive/av_tfrecords/drumming_7zip.zip" -o"/content/gdrive/My Drive/unzipped_av_tfrecords/" -aos

这会在引发错误之前提取 zip 文件的某些部分。有各种各样的错误,有时代码甚至不会在抛出错误之前开始解压缩文件。这是最常见的错误:

Can not open the file as archive

ERROR: Unknown error -2147024891

Archives with Errors: 1

如果我随后尝试重新运行 !7za 命令,它可能会在抛出此错误之前从 zip 文件中提取一或两个文件:

terminate called after throwing an instance of 'CInBufferException'

它也可能会抱怨 zip 存档中的特定文件:

ERROR: Headers Error : drumming/yt-g0fi0iLRJCE_23.tfrecords

我也试过使用:

!unzip -n "/content/gdrive/My Drive/av_tfrecords/drumming_7zip.zip" -d "/content/gdrive/My Drive/unzipped_av_tfrecords/"

但这才开始引发错误:

file #254:  bad zipfile offset (lseek):  8137146368

file #255:  bad zipfile offset (lseek):  8168710144

file #256:  bad zipfile offset (lseek):  8207515648

虽然我更喜欢 Colab 中的解决方案,但我也尝试使用 GDrive 中可用的名为 "Zip Extractor" 的应用程序。但这也会引发错误并具有数据配额。

这已经发生在 4 个 zip 文件中,每次我尝试新的东西时,由于上传速度的原因,都需要很长时间才能尝试。对于为什么会发生这种情况以及我如何解决该问题的任何解释,将不胜感激。我也明白,除了我正在尝试做的事情之外,可能还有其他选择,即使他们没有直接回答问题,他们也将不胜感激。谢谢!

我遇到了同样的问题

通过

解决
new ProcessBuilder(new String[] {"7z", "x", fPath, "-o" + dir)

使用命令行数组,而不仅仅是整行!

运气好!

Why does this command behave differently depending on whether it's called from terminal.app or a scala program?