How can i read files using 64 bit file pointer in linux?
Thanks.
Printable View
How can i read files using 64 bit file pointer in linux?
Thanks.
I think that some more recent versions of the kernel/libc should support large files inherently... otherwise you will need to use the large file interface:
pass O_LARGEFILE to open() -- see man 2 open and man 5 lf64.
Hope this helps.
Edit: actually, it might be simpler than that -- write as normal using a FILE*, fopen(), etc; include:
(or pass -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 to gcc)Code:#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64