According to the unix man pages ftell
either returns -1 to indicate an error.
The function definition is:
long int ftell ( FILE * stream );
Where long int
is a 32 bit integer (you need long long
for 64 bit)
however (-1L) == 0x00000000FFFFFFFF LL
which should be a valid value for really large files (round about 4GB) in which case, how do we know whether an error has occurred or we just have a really large file?