Reputation: 597
What strategy should I use if I have an implementation of std::fstream with 32-bit std::streampos? If I want to move position I can do it in several steps(10gb - 10 times +1gb). How can I get position? Or should I keep current position in some variable outside fstream?
P.S. I can't change the implementation of STL.
Upvotes: 5
Views: 900
Reputation: 14459
Keeping track of the current position yourself is the most straight-forward answer, if you're unable to addle the STL. If your compiler support the long long
type, I'd go with that.
Upvotes: 1