How do perform file positioning operations with large (64-bit) offsets?
If you’re using a raw Device and your compiler supports a 64-bit integral type, you can pass a large offset directly to seek. To convert the return value of seek to an integral type, use position_to_offset. If you’re using a stream_buffer or filtering_streambuf, convert the offset to a std::streampos using offset_to_position, then pass it to pubseekpos. To convert the return value of seek to an integral type, use position_to_offset. If you’re using a stream or filtering_stream, convert the offset to a std::streampos using offset_to_position, then pass it to the overload of seekg or seekp which takes a single std::streampos argument. To convert the return value of seek to an integral type, use position_to_offset. See Stream Offsets.