[GRASS-dev] Return value from g.copy is one when --overwrite - bug or feature?
Rainer M Krug
Rainer at krugs.de
Mon Nov 9 00:50:15 PST 2015
Markus Neteler <neteler at osgeo.org> writes:
> On Sun, Nov 8, 2015 at 11:22 AM, Rainer M Krug <Rainer at krugs.de> wrote:
>> Huidae Cho <grass4u at gmail.com> writes:
>>> I cannot seem to replicate your issue:
>>> G srorg6630/tmp ~> g.version
>>> GRASS 7.1.svn (2015)
>>> G srorg6630/tmp ~> g.list region
>>> G srorg6630/tmp ~> g.copy region=tmp,tmp1 --overwrite
>>> Copy region definition <tmp at tmp> to current mapset as <tmp1>
>>> G srorg6630/tmp ~> echo $?
>>> g.copy returns 1 when it cannot either read the source or write to the
>>> target. Please check your permissions on your region files in
>> You are correct - they are read only.
>> So the return value is correct - but an error should be raised - or is
>> there a reason why this should silently fail?
> It should probably not silently fail.
Absolutely not - this can lead to errors as one assumes that no error
message means that the command was successful - I usually don't check
the return codes when I am working in a terminal.
> The code in question is in
> and potentially there to be added strerror(errno) as for example in
I don't know the inner workings of GRASS - but it looks like a good place?
On a related note - are the return codes documented somewhere (apart
From the source code)? OK - 0 is evident, but the others? They seem to
have specific meanings in GRASS?
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer at krugs.de
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 454 bytes
Desc: not available
More information about the grass-dev