Handling Large Files 4gb
Does anyone have experience handling large files(4gb and above) using C++ and the Win32 API?
I'm using stuff like fgetpos and the likes, but the functions when opening a 9gb file seem to be returning a filesize of 0, without triggering an error.
Does anyone have experience with this?
You'll probably need to use native API functions to manipulate large files. For example, to get the file pointer you should use SetFilePointerEx() with a move method of FILE_CURRENT and a distance of zero.
There's 64-bit versions of some of the CRT functions, although it's visual studio specific. _filelengthi64 might be what you need.
As far as I know there's no 64-bit version of fgetpos or ftell though. If you need them, you might need to switch to raw Win32 file handles (I don't know if the C++ iostreams library copes with files over 4GB).
As far as I know there's no 64-bit version of fgetpos or ftell though. If you need them, you might need to switch to raw Win32 file handles (I don't know if the C++ iostreams library copes with files over 4GB).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement