[prev in list] [next in list] [prev in thread] [next in thread]
List: boost-bugs
Subject: [Boost-bugs] [Boost C++ Libraries] #5237: filtering_ostream produce
From: "Boost C++ Libraries" <noreply () lists ! boost ! org>
Date: 2011-02-27 11:07:17
Message-ID: 053.2512b637e9eda57eb07c324e6ac73b56 () lists ! boost ! org
[Download RAW message or body]
#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
Keywords: |
----------------------------------+-----------------------------------------
The attached program should produce an empty gzip file, using the
gzip_compressor:
{{{
int main()
{
using namespace boost::iostreams;
filtering_ostream os;
os.push(boost::iostreams::gzip_compressor());
os.push(boost::iostreams::file_sink("emptyGzipBug.txt.gz"));
}
}}}
The resulting file is not a gzip file:
{{{
$ hexdump emptyGzipBug.txt.gz
0000000 0003
0000002
$ zcat testGzipEmpty.txt.gz
zcat: testGzipEmpty.txt.gz: not in gzip format
$
}}}
A workaround is to manually force an empty write into the stack of
components with something like this:
{{{
char dummy = 'b';
os.component<gzip_compressor>(0)->write(*os.component<file_sink>(1),
&dummy, 0);
}}}
The problem seems to affect all versions, including Boost 1.46.0
--
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5237>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
_______________________________________________
Boost-bugs mailing list
Boost-bugs@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic