discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] fseek cont: reading file position beyond 32 bits


From: Stephane Fillod
Subject: Re: [Discuss-gnuradio] fseek cont: reading file position beyond 32 bits
Date: Tue, 8 Feb 2005 23:45:36 +0100
User-agent: Mutt/1.5.6+20040907i

On Wed, Feb 09, 2005 at 09:02:54AM +1030, Daniel O'Connor wrote:
> On Wed, 9 Feb 2005 08:33, Stephane Fillod wrote:
> > On Tue, Feb 08, 2005 at 04:21:48PM -0500, cswiger wrote:
> > > Hi - Not a big issue, I'm experiment with 'ftell' to read the
> > > current position in a big file, it would be nice to know 'where'
> > > in a 1.5 hour recording we are listening to for later reference.
> > > pos=ftell(*fp) works as expected, but only up to 2^32/2. It
> > > appears to be a limitation in ftell(), as returning "long long"
> > > and pre-dividing by d_itemsize still hit the same barrier -
> > > returning "long long" made no difference and pos=ftell(*fp)/d_itemsize
> > > returns errors at the 2^32/2/4 (float data in this case).
> > >
> > > Any ideas? Again, not a showstopper. Current data file is 13Gb.
> >
> > Looks like you will have to use ftello() and define _LARGEFILE_SOURCE.
> 
> What is the define for?

This is to turn the usual 32 bit off_t type into a 64 bit type.
Under GNU/Linux, see ftello(3) and /usr/include/features.h

> On my system (FreeBSD) ftello() is all you need.
> 
Lucky you. 64bit system owners are also on the lucky side.
Better yet, they may even mmap the whole file :*)

-- 
SF




reply via email to

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