How can I seekg() files over 4GB on Windows?
-
29-10-2019 - |
Pergunta
I am on Windows 7, 64bit and NTFS. I am building a DLL that must be 32 bit. I have a very simple routine that I'd like to implement in C++. I'm reading a large file using:
unsigned long p;
ifstream source(file);
streampos pp(p);
source.seekg(pp);
For files over 4GB I tried using unsigned long long but it's not working. What am I doing wrong? I'm using GNU GCC, would it be of any use trying MSVC Express 2008/2010?
Update:
There seems that something is wrong with my GCC. Right now I'm testing your proposals using MSVC and it seems that is working. MSVC uses an _int64 to represent streampos/streamoff objects, I will check later with GCC.
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow