On Mon, 3 Sep 2007, Michael Barton wrote:

The problem in this and other cases is that the warning is sent to stderr
when the command operates and exits properly. Error messages are sent to
stderr when the command does not operate properly and/or exits with an
error. There is no easy way (maybe no way in many cases) for a script to
tell the difference.

I think Tcl's deficiencies are confusing you. Tcl cannot tell the difference and this is IMHO a major bug in Tcl. But it is a single exception. Operating systems and probably almost all other scripting languages use the exit code of the program: a zero exit code indicates it exited successfully; a non-zero exit code indicates it exited with an error.

In any case Maris seems to have found a workaround to Tcl's deficiency: check the global variable errorcode after running an external command. I'm waiting to see if anybody comes up with a problem with this approach.

_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to