Re: How to handle files with sizes >32bit?



2009/1/23 Dan Ium <dacium gmail com>:
It seems that in linux ftello64 does not work, it always returns 0.
Also fseeko64 never seeks beyond a 2GB position, and fopen fails to
open files over 4GB.

There's nothing to do on linux to get large file support. Just put:

AC_SYS_LARGEFILE

in your configure.in and it sets a few defines for you and it all
works. Now off_t and friends are 64-bits and
lseek()/open()/read()/write() all work with 64 bits.

Now just use ftello (the version that returns an off_t) and you code
will work everywhere without change, and use 64-bit offsets if they
are supported. Hopefully! I wouldn't use ftello64().

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]