[GRASS-dev] grass location creation

Glynn Clements glynn at gclements.plus.com
Thu Mar 8 21:52:15 EST 2007


Hamish wrote:

> > > +        if (flag.savedefault->answer) {
> > > +            char *location = G_location_path();
> > > +            char *path = (char *) G_malloc(sizeof(location)+64);
> > > +            strcpy(path,location);
> > > +            strcat(path,"/PERMANENT/");
> > > +            G__put_window( &window, path, "DEFAULT_WIND" );
> > > +        }
> > 
> > The second argument to G__put_window has to be an "element", i.e. a
> > directory in the current mapset. r.in.gdal uses "../PERMANENT", which
> > works because the element is simply concatenated onto the path to the
> > mapset directory.
> > 
> > I suggest that you adopt the same approach, i.e.:
> > 
> > 	G__put_window( &window, "../PERMANENT", "DEFAULT_WIND" );
> 
> as this should only be working if the current mapset is PERMANENT,
> could/should that be shortened to "."?
> 
> G__put_window( &window, ".", "DEFAULT_WIND" );

If it only needs to work in PERMANENT, use "".

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




More information about the grass-dev mailing list