Python bz2未压缩的文件大小 [英] Python bz2 uncompressed file size
问题描述
我使用Python 2.7。我有一个.bz2文件,我需要弄清楚其组件文件的未压缩文件大小,而不实际解压缩它。
我找到了方法来做这个gzip和tar文件。任何人都知道bz2文件的方法?
I am using Python 2.7. I have a .bz2 file, and I need to figure out the uncompressed file size of its component file without actually decompressing it. I have found ways to do this for gzip and tar files. Anyone know of a way for bz2 files?
非常感谢
推荐答案
p>我怀疑这是不可能的,因为它使用的 bz2 格式和压缩技术的性质。这里有一个很好的描述格式和算法 http://en.wikipedia.org/ wiki / Bzip2#File_format
I suspect this is impossible due to the nature of bz2 format and compressing techniques it uses. Here is a quite good description of the both format and the algorithms http://en.wikipedia.org/wiki/Bzip2#File_format
在解压缩之前,你永远不会知道原始数据大小。
You will never know original data size until you decompress it.
这篇关于Python bz2未压缩的文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!