User:Saul/C

From Organic Design wiki
< User:Saul
Revision as of 03:08, 21 September 2021 by Saul (talk | contribs) (Add note about seeking above 2gb.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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