[GRASS-dev] vector large file support

Glynn Clements glynn at gclements.plus.com
Wed Feb 4 19:24:11 EST 2009


Markus Metz wrote:

> I think I understand. So according to the grass wiki the steps to enable 
> large file support would be
> 
> 1) add
> ifneq ($(USE_LARGEFILES),)
> EXTRA_CFLAGS = -D_FILE_OFFSET_BITS=64
> endif
> 
> to all relevant Makefiles

Yes. Although this should probably come after 2 and 3 ;) First, make
the code safe for LFS, *then* enable it.

> 2) use off_t where appropriate, and take care with type casting. file 
> offset is used in various different places in the vector library, a bit 
> of work to get off_t usage right.

Using off_t isn't a problem; it's when you generate an off_t from
smaller types that care needs to be taken.

> 3) solve the fseek/fseeko and ftell/ftello problem. Get inspiration from 
> libgis and LFS-safe modules? Or as suggested in the grass wiki on LFS, add
> extern off_t G_ftell(FILE *fp);
> extern int G_fseek(FILE *stream, off_t offset, int whence);
> for global use?

That would be my preference.

> 4) figure out if coor file size really needs to be stored in coor and 
> topo. coor file size doesn't say a lot about the number of features 
> because coor can contain a high proportion of dead lines (a problem in 
> itself, vector TODO). If if does not need to be stored in coor and topo, 
> how does removing coor file size info affect reading and writing of coor 
> and topo? Are there hard-coded offsets for reading these files?

No idea here.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list