[GRASS-dev] Re: gis.m crashes on zoom to map existing in more than one mapset

Glynn Clements glynn at gclements.plus.com
Sat Jan 6 01:51:15 EST 2007


Glynn Clements wrote:

> I would suggest having a global variable which refers to a "sink" to
> which stderr can be safely redirected in situations like this. Valid
> values would be anything which can appear after "2>" in an exec (or
> "open |...") command, e.g. @stderr (i.e. gis.m's stderr, typically a
> terminal, although this may not be valid on non-Unix systems), the
> name of a log file, or /dev/null (or NUL on Windows).

In case it wasn't obvious, the idea is that code which doesn't want
stderr mixed with stdout and doesn't want exceptions can just add
"2> $sink" to make stderr "go away". We can argue over where to send
it later.

Apart from the terminal, a log file or /dev/null, there's also the
possibility of redirecting it to a FIFO, from where gis.m can read it
and send it to the gronsole. However, this approach can potentially
stall the child process if gis.m doesn't keep the FIFO drained. In
most cases, writing stderr to a temporary file then dumping the
contents to the gronsole afterwards would be preferable.

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




More information about the grass-dev mailing list