[GRASS5] r.terraflow failure

Glynn Clements glynn at gclements.plus.com
Tue Feb 21 17:21:08 EST 2006

Andrew Danner wrote:

> My initial hunch is that this may be an fseek error. The function
> scan3line where the assertion fails is opening three file descriptors or
> "substreams" on a single file and calling fseek to move to the beginning
> of a particular row.  However, fseek takes a 32-bit long offset which
> overflows at 2GB. There is an fseeko in most stdio.h implementations
> that takes a 64 bit off_t offset and works for larger files. 

Just to clarify: fseeko takes an off_t, which may be either 32 or 64
bits depending upon the value of the _FILE_OFFSET_BITS macro.

Note that, in order to use 64 bit offsets, you need to ensure that
values don't get truncated to 32 bits by C's typing rules and/or
storage in int/long variables.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list