Boost C++ Libraries: Ticket #1033: iostreams::restrict doesn't work on an iostreams::file_source https://svn.boost.org/trac10/ticket/1033 <p> I ran into a problem when using restrict on a file_source. The problem was that it decided that the stream wasn't seekable and called the version of skip that reads a character at a time until it gets to the requested offset, instead of just calling seek. </p> <p> The code was similar to this: </p> <pre class="wiki">namespace io = boost::iostreams; std::string filename; io::filtering_istream rstr(io::restrict(io::file_source(filename), 10, 100)); </pre><p> I've attached a patch that solved my problem. It was checking to see if the device was seekable (which means both input_seekable and output_seekable), but since it was an input device, it was just input_seekable. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1033 Trac 1.4.3 phil@… Tue, 05 Jun 2007 03:27:34 GMT attachment set https://svn.boost.org/trac10/ticket/1033 https://svn.boost.org/trac10/ticket/1033 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">skip.patch</span> </li> </ul> Ticket Marshall Clow Mon, 13 Aug 2007 15:29:16 GMT owner set https://svn.boost.org/trac10/ticket/1033#comment:1 https://svn.boost.org/trac10/ticket/1033#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Douglas Gregor</span> </li> </ul> Ticket Marshall Clow Sun, 19 Aug 2007 15:24:11 GMT owner, component changed https://svn.boost.org/trac10/ticket/1033#comment:2 https://svn.boost.org/trac10/ticket/1033#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Marshall Clow</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iostreams</span> </li> </ul> Ticket Marshall Clow Sun, 19 Aug 2007 15:25:20 GMT owner deleted https://svn.boost.org/trac10/ticket/1033#comment:3 https://svn.boost.org/trac10/ticket/1033#comment:3 <ul> <li><strong>owner</strong> <span class="trac-author">Marshall Clow</span> removed </li> </ul> Ticket Marshall Clow Thu, 27 Sep 2007 14:05:47 GMT owner set https://svn.boost.org/trac10/ticket/1033#comment:4 https://svn.boost.org/trac10/ticket/1033#comment:4 <ul> <li><strong>owner</strong> set to <span class="trac-author">Jonathan Turkanis</span> </li> </ul> Ticket Jonathan Turkanis Wed, 26 Dec 2007 01:08:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1033#comment:5 https://svn.boost.org/trac10/ticket/1033#comment:5 <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">fixed</span> </li> </ul> <p> fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/42305" title="Resolved issue #1033 (iostreams) restrict.hpp: - added static ...">[42305]</a> in branches/iostreams_dev, to be merged into trunk shortly. </p> Ticket