[GRASS-dev] how to deal with the @mapset in scripts?

Maciej Sieczka tutey at o2.pl
Wed Jul 4 09:17:29 EDT 2007


Glynn Clements wrote:
> Maciej Sieczka wrote:
> 
>>> Why do you actually need to use g.findfile? In most cases, you should
>>> just pass the map name directly to the command, and let the command
>>> handle the checking.
>> It's better to check if the output exists in the initial stage of my
>> script, than to let it run for an hour and then fail with an error that
>> the output already exists in the end.
> 
> If the output map is specified by an option whose "gisprompt" setting
> includes "new", g.parser will automatically ensure that it doesn't
> exist unless --o[verwrite] is given or $GRASS_OVERWRITE == 1.

You are correct. The reason that this has not worked for me like that
is that I've been using "gisprompt: new,dig,vector" instead of
"gisprompt: new,vector,vector".

I must have copied this "gisprompt: new,dig,vector" from some GRASS 5
script and sticked to that. None of the scripts in 6.3 uses it. Is this
not supposed to be recognised by g.parser indeed? There isn't any error
message that this is incorrect. Should there be one?

Grepping through the GRASS 6.3 source code I can see that v.surf.rst
still uses the old syntax in main.c twice. Should that be fixed?

Maciek




More information about the grass-dev mailing list