[GRASS-user] r.in.xyz: Could open text file ~ 2.5GB

Glynn Clements glynn at gclements.plus.com
Fri Oct 20 11:20:32 EDT 2006


Patton, Eric wrote:

> I applied your patch in the root of my source code folder (/opt/grass6)
> using this command:
> 
> patch -p0 < r.in.xyz_LFS_patch
> 
> then 'make' within grass6/raster/r.in.xyz, and make install from grass6.
> 
> Is that command sequence correct? I'm unfamiliar with patching.

Yes; but see below.

Although, rather than running "make install", you can run the
newly-built version in-place by running the grass63 script in the
bin.<arch> directory, e.g.:

	/opt/grass6/bin.i686-pc-linux-gnu/grass63

> If so, I'm
> still receiving the same error when r.in.xyz tries to open my input file:
> 
> >r.in.xyz -s input=GarryTrough_1N_2006.txt output=test fs=space
> ERROR: Could not open input file <GarryTrough_1N_2006.txt>.
> 
> Could my OS be imposing some sort of file size limit despite LFS in
> r.in.xyz? I'm using Ubuntu 6.06 on a 32-bit PC.

I forgot that the --enable-largefile switch only enables LFS in
libgis, not anywhere else.

[Although config.h includes definitions to enable LFS automatically,
those definitions are currently inactive. This is probably a good
thing; a lot of GRASS' code isn't LFS-aware, and explicit failure is
preferable to silently corrupting data.]

To enable LFS elsewhere, you need to manually add
-D_FILE_OFFSET_BITS=64 to the compilation flags. The simplest approach
is to add:

ifneq ($(USE_LARGEFILES),)
	EXTRA_CFLAGS = -D_FILE_OFFSET_BITS=64
endif

to raster/r.in.xyz/Makefile, then repeat the "make" and "make install"
steps.

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




More information about the grass-user mailing list