Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5237: filtering_ostream produce incorrect empty files with gzip_compressor and other filters
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-06 20:24:41
#5237: filtering_ostream produce incorrect empty files with gzip_compressor and
other filters
-----------------------------------+----------------------------------------
Reporter: come.raczy@⦠| Owner: turkanis
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iostreams
Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------------------------
Comment (by Davin):
Same issue in 1.47.0 and 1.48.0.
You can patch boost/iostreams/filter/gzip.hpp, at line 251, insert the
following two lines:
{{{
if (!(flags_ & f_header_done))
write(snk, 0, 0);
}}}
If nothing has been written, calling write with no content will generate a
proper empty gzip file. This is preferable to having a zero-length file
for two reasons. First, it is consistent with the bzip2 filter to create
a proper empty compressed file rather than a zero-length file. Second,
zcat won't subsequently barf with a "unexpected end of file" error.
Hope it helps.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5237#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC