kspalaiologos / bzip3

A better and stronger spiritual successor to BZip2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: add fflush when encode/decode complete

synodriver opened this issue · comments

Sometimes I got empty output files after encode/decode. I did some search and found that bzip3 just use fclose after complete. I have encountered this problem myself in the python wrapper, and after I use flush on file stream it's fixed. So maybe the origin one should add it too?

This can be reproduced with the latest release, both on windows and linux.

Is there precedent for doing a flush in other archive/compression tooling? This doesn't sound quite right...

The fclose() function flushes the stream pointed to by stream (writing any buffered output data using fflush(3)) and closes the underlying file descriptor.

Per man fflush. I can add it nonetheless, but it seems like you're running a non-standards compliant platform.

Stale and a suggested fix has been pushed. Closing.