简体   繁体   中英

std::fstream files more than 2gb

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?

PS I can't change the implementation of STL.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM