Python 中特定用途的压缩类型
我实际上在这个线程中部分地问过这个问题 使用 python 组织 tar bz2 文件中的文件 但这让我重新思考我在做什么。
现在我认为改变我正在使用的压缩方法可能是个好主意。我目前正在使用 tar.bz2 压缩。我需要做的是一次访问一个压缩文件,特别是按名称,将它们构建到另一个文件中。 Zip 压缩应该可以很好地支持这一点,但是我正在压缩的文件数量(200,000 个 txt 文件)对于该文件类型来说似乎太大了。 Zip 只能支持 64k 文件或类似的文件。有谁知道我应该使用哪种压缩类型?
另外,如果有一个为其构建的 python 库(例如 tarfile、zipfile 等)也会有所帮助。
I actually partially asked this in this thread
Organizing files in tar bz2 file with python
But it mad eme rethink what I was doing.
Now I think it might be a good idea to change the compression method I am using. I am currently using tar.bz2 compression. What I need to be able to do is access the compressed files one at a time, and specifically by name, to build them into a different file. Zip compression is supposed to support this well, but the number of files I am compressing, 200,000 txt files, seem to be to large for that file type. Zips can only support 64k files, or something like that. Does anyone have any idea of what compression type I should use?
Also, it would help if there was a python library built for it, such as tarfile, zipfile etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以压缩各个文件并将它们放入 tar(或 ar)容器中。
You could compress the individual files and put those into a tar (or ar) container.