Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

std::fstream files more than 2gb

Tags:

c++

fstream

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.

like image 635
Andreo Avatar asked Nov 14 '22 15:11

Andreo


1 Answers

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.

like image 136
Chris Tonkinson Avatar answered Dec 19 '22 07:12

Chris Tonkinson