简体   繁体   English

有没有办法阻止使用 zip、gzip 或 zlib 解压缩压缩文件?

[英]Is there way to block uncompress a compressed file using zip, gzip or zlib?

I want to give some sort of an 'offset' where the zlib will start its decompression from at init,我想给出某种“偏移量”,zlib 将从 init 开始解压缩,

I have control over how file is compressed.我可以控制文件的压缩方式。

My question is, is there any block or boundary concepts in traditionally compressed files?我的问题是,传统压缩文件中是否有任何块或边界概念?

Not necessarily looking for 'random access', say start from offset 0, uncompress blocks A, B, and C, (concurrently or serially), and then in future want to continue from block D, (next reboot time init zlib to start from block D, for example).不一定要寻找“随机访问”,比如从偏移量 0 开始,解压缩块 A、B 和 C,(同时或串行),然后将来想从块 D 继续,(下次重启时 init zlib 从块 D,例如)。

When working with large files like 10 or 100GB, continuity of uncompressing helps.在处理 10 或 100GB 等大文件时,连续解压缩会有所帮助。

Environments: Linux/C/C++环境:Linux/C/C++

Thanks for your help.谢谢你的帮助。

Apparently gztool and bgzf compression tools can help, but they create index files, as well.显然 gztool 和 bgzf 压缩工具可以提供帮助,但它们也会创建索引文件。 Winzip, zip or gzip traditionally not block or boundary based, not sure if they can help. Winzip、zip 或 gzip 传统上不是基于块或边界的,不确定它们是否可以提供帮助。

That's what Z_FULL_FLUSH is for.这就是Z_FULL_FLUSH的用途。 Use that to deflate, writing all available output. Save the offset of the position in that output. You can then later begin a raw inflate from that offset.使用它来缩小,写入所有可用的 output。将 position 的偏移量保存在该 output 中。然后您可以稍后从该偏移量开始原始膨胀。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM