From octave-maintainers-request at bevo dot che dot wisc dot edu Fri Nov 21 08:17:12 2003 Subject: Re: file offsets used by fseek and ftell From: "John W. Eaton" To: JD Cole cc: octave-maintainers mailing list Date: Fri, 21 Nov 2003 08:17:02 -0600 On 21-Nov-2003, JD Cole wrote: | Could this be accomplished using a 64-bit (long long). If I'm | not totally off base, that may be a better solution. With gcc 3.4, streamoff and streampos are classes that hold 64-bit ints (either long long or int64_t). But they are not simple typedefs for either of these types, so it is still not possible to write something like streampos pos = ...; long long ftell_retval = (long long) pos; because there is no way to cast a streampos or streamoff type to an integer. For portability, we can't assume that these types are any particular integer value. Different systems are free to implement streamoff and streampos (or fpos_t if you are using C) in any way they choose (provided that they meet the rather limited constraints of the respective standards). Note that the MathWorks is going to face similar problems if they wish to support large files in Matlab. jwe