gpt4 book ai didi

c# - 归档数千个文件和 7zip 限制

转载 作者:太空狗 更新时间:2023-10-29 19:41:52 25 4
gpt4 key购买 nike

我的应用程序要求每天运行一项任务,其中需要压缩 100,000 多个 PDF(每个约 50kb)文件。目前,我正在使用 7-zip 并调用 7za.exe(7-zip 的命令行工具)来压缩每个文件(文件位于许多不同的文件夹中)。

这种方法有什么局限性,如何解决? 7zip 存档是否有文件大小或文件数限制?

最佳答案

文件大小限制为 16 艾字节,或 16000000000 GB。

文件数量没有硬性限制,但在管理文件头的方式上存在实际限制。确切的限制取决于路径长度,但在 32 位系统上,您将遇到大约一百万个文件的限制。

我不确定是否有任何其他格式支持更多。普通 zip 的限制要小得多。

http://en.wikipedia.org/wiki/7-Zip

One notable limitation of 7-Zip is that, while it supports file sizes of up to 16 exabytes, it has an unusually high overhead allocating memory for files, on top of the memory requirements for performing the actual compression.

Approximately 1 kilobyte is required per file (More if the pathname is very long) and the file listing alone can grow to an order of magnitude greater than the memory required to do the actual compression. In real world terms, this means 32-bit systems cannot compress more than a million or so files in one archive as the memory requirements exceed the 2 GB process limit.

64-bit systems do not suffer from the same process size limitation, but still require several gigabytes of RAM to overcome this limitation. Archives created on such systems would be unusable on machines with less memory however.

关于c# - 归档数千个文件和 7zip 限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4513670/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com