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 5368709120 exists too. It works perfectly fine if I use: is.seekg (100, is.beg);
for example.
Using multiple seeks is not an option since the files can get up to 300GB (and using many seeks will be slow).
My question is: how can I get seek to work correctly on a 10GB file without using multiple seeks?