Boost C++ Libraries: Ticket #4554: [MSVC] gzip_decompressor in filtering_istream returns empty strings | doesn't indicate EOF correctly https://svn.boost.org/trac10/ticket/4554 <p> The attached is a classical zcat example. It constructs a <code>filtering_istream</code> out of <code>std::cin</code> and <code>gzip_decompressor()</code>, and clones its contents to <code>std::cout</code>. Being built with GCC on unices, this works flawlessly. Being build with MSVC 10, this fails on the attached files. </p> <p> With the first file, <code>1.gz</code>, the example enters infinite loop, continuously printing empty lines on stdout; getline() returns empty strings. </p> <p> With the second file, <code>2.gz</code>, the example successfully dumps decompressed content, but in the end of the stream enters infinite loop again, this time for the reason of stream_in.eof() always returning false. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4554 Trac 1.4.3 ulidtko@… Tue, 17 Aug 2010 18:42:42 GMT attachment set https://svn.boost.org/trac10/ticket/4554 https://svn.boost.org/trac10/ticket/4554 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> <p> classical zcat example </p> Ticket ulidtko@… Tue, 17 Aug 2010 19:55:40 GMT status, component changed; resolution set https://svn.boost.org/trac10/ticket/4554#comment:1 https://svn.boost.org/trac10/ticket/4554#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iostreams</span> </li> </ul> <p> I'm apologizing for inconvenience. The issue was not a Boost bug, rather an attempt to read a gzipped file in windows text mode. The solution is to use <code>std::ios_base::binary</code> flag. </p> Ticket