[GRASS-dev] [bug #4522] (grass) r.series: error in row of input
map is non-fatal giving wrong results
Glynn Clements
glynn at gclements.plus.com
Thu Jun 1 09:27:00 EDT 2006
Hamish wrote:
> > a) G_get_raster_row() etc should automatically call G_fatal_error() if
> > an error occurs, with a function to disable this behaviour for modules
> > which really need to do their own error handling.
>
> ok
>
> > b) It should be the library's responsibility to clean up incomplete
> > maps upon exit.
> >
> > Having to manually check for error conditions and perform clean-up
> > whenever an error occurs is enough of a nuisance that it will
> > frequently be omitted (or, if error handling is added, those code
> > paths will seldom get tested and thus will frequently contain bugs).
>
> does that mean you have to start sending the file descriptors, etc,
> along to the lib fns? While one read error probably means many, waiting
> for cleanup-on-GRASS-exit seems less messy somehow.
>
> Should G_get_raster_row() do system("$GISBASE/etc/clean_temp") before
> calling G_fatal_error() ?
My comment was limited to cleaning up the temporary cell/fcell file
created when writing new raster maps. Essentially, G_open_raster_new()
etc would need to use atexit() to automatically "unopen" any
incomplete maps.
Applications would be responsible for cleaning up their own temporary
files.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list