Seeking in a file that is more than 4GB in C++? [duplicate]
问题 This question already has answers here : Reading files larger than 4GB using c++ stl (5 answers) Closed 4 years ago . I am using the MS Visual Studio 2012 compiler and I am building in x64 release mode. Using ifstream I can read files larger than 4GB. The problem is, I can't seek to a position in the middle of a 10GB file. When I use seekg like this is.seekg (5368709120, is.beg); then is.tellg(); returns -1 which means the seek failed. I am sure that the file exists and the position