[GRASS5] stdout and stderr

Hamish hamish_nospam at yahoo.com
Sun Oct 17 19:22:22 EDT 2004


> I was just wondering about the appropriateness of writing different
> types of module output to stderr or stdout,


I'm totally not sure; the reason for splitting off the progress info from
the copyright information in v.surf.rst was to [at some point in the
future] make it possible to clean up the term output in the r.fillnulls
script without hiding the G_percent() progress. As this is usually just
filling a few cells here and there I didn't think it would be too
abusive of the authors' wish for some credit for their hard work when
the module is used extensively. There isn't anything in that module
which might be redirected to a file or piped to another program.

d.where and r.univar2 are good examples of where there is output which
could be redirected to a file or piped to another program, and there you
get a mix of stdout and stderr.

Another thing to consider is the tcl menus: stderr is written
immediately while stdout gets buffered and displayed after the module
finishes. So progress messages should always be sent to stderr to cover
that.

Also, I see that d.info uses a plain printf(), for whatever that's
worth.



Hamish




More information about the grass-dev mailing list