Sangcheol Choi
Sangcheol Choi

Reputation: 841

How to estimate progress of decompress of bzip2 file using C function?

I could use gzoffset function in zlib to estimate the remaining uncompress file size. Is there a similar function in bzip2 library? If not, is there any trick that I can use?

Upvotes: 1

Views: 900

Answers (1)

Mark Adler
Mark Adler

Reputation: 112269

Just track the amount of compressed data consumed. When you have processed xx% of the compressed data, you have generated approximately xx% of the uncompressed data.

gzoffset() does not tell you anything about the remaining uncompressed file size. It only tells you how many bytes you have uncompressed so far. You can get that simply by counting how many bytes you have uncompressed so far.

Upvotes: 1

Related Questions