[GRASS-dev] Re: [GRASS-windows] Problems with Mapcanvas

Glynn Clements glynn at gclements.plus.com
Thu Nov 22 13:01:50 EST 2007


Hamish wrote:

> > Although we should also change the code which is putting the
> > CRs there in the first place (assuming that's what's happening).
> 
> lib/gis/key_value2.c has G_fwrite_key_value(), but that does this:
>   fprintf (fd, "%s: %s\n",
> 
> r.in.gdal uses that through G_make_location()
> The other way to make a new location is through g.proj -c (GUI startup screen
> uses this) but that uses G_write_key_value_file() too, as does g.setproj.
> 
> ?

G_write_key_value_file() does fopen(file, "w"). Normally, I would
expect this to open the file in text mode (with platform EOL
conversions), although I don't know if the _fmode=O_BINARY setting
affects this.

But then G_read_key_value_file() also opens the file in text mode, so
I'm not really sure what's going on.

> > > also, should that be using "(buf, sizeof(buf)-1, fd" ?
> > 
> > Yes and no. The current behaviour of G_getl2() requires it, but it's
> > G_getl2() which should be changed to match G_getl(), fgets() etc.
> 
> fine with me.

I'll change this in CVS.

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


More information about the grass-dev mailing list