User:Saul/C

From Organic Design wiki

Seeking Above 2GB

If you are on linux, seeking can be done using long for the type with the methods: fseek and ftell. This will not work on windows because their long's are 32 bits.


Another alternative is to use off64_t with the method lseek64. To use this method you must add the following to the end of your includes (must be last)

#define __USE_LARGEFILE64
#include <unistd.h>
#include <sys/types.h>

Compile with -D_FILE_OFFSET_BITS=64 -Doff64_t=__off64_t