I mapped my file to memory using boost::iostreams::mapped_file_source
and declared a stream to read the file as boost::iostreams::stream <boost::iostreams::mapped_file_source> streamReader
.
It worked fine and I was able to parse the memory mapped file. I used getline
to read the entire file and stored certain offsets from the file. While performing this operation I was able to use seekg
to seek streamReader to desired position. But once the whole file is read, I cannot seek streamReader to anywhere.
streamReader.fail()
returns true. Does streamReader clears the pointer once it reaches the end of file?
Is there some way so that I can go to the desired file offset after reading the entire file?
ThankYou