[GRASS-user] r.terraflow error for ASTER DEM.

Glynn Clements glynn at gclements.plus.com
Sun Jul 5 17:29:40 EDT 2009


Hamish wrote:

> >  G_convert_dirseps_from_host(G_store(getenv("TEMP")));
> 
> is %TEMP% guaranteed to exist in Windows-land?

AFAIK, the only way that it won't exist is if the user manually unsets
it. I wouldn't count upon the rest of Window working if you do that,
though; Windows doesn't have a global temporary directory along the
lines of /tmp or /var/tmp.

> How does the module react if it is not set and the user stays
> with the default or doesn't notice that the default is blank?

If it's not set, getenv() will return NULL and G_store() will
segfault. A check leading to G_fatal_error() can be added to G_store()
if desired (or to the above code).

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


More information about the grass-user mailing list