$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Reading a file in reverse using boost::iostreams
From: Gavin Lambert (boost_at_[hidden])
Date: 2019-02-12 23:08:53
On 13/02/2019 05:33, Sean Farrow wrote:
> Is there an easy way to read a file in reverse using boost::iostreams?
>
> Ive got a case where I need to detect whether text is present and its
> closer to the end of the file than the beginning.
You should be able to read the length of the stream, then seek to a
position near the end and read forwards from there.
Of course, you need to know a suitable value to use as the range where
you expect the value to be present; if you get this wrong then you'll
either have a false negative or you'll waste a bit more time jumping
back further and trying again.