octave-maintainers
[Top][All Lists]
Advanced

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

Re: file offsets used by fseek and ftell


From: John W. Eaton
Subject: Re: file offsets used by fseek and ftell
Date: Fri, 21 Nov 2003 08:17:02 -0600

On 21-Nov-2003, JD Cole <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]