[GRASS5] OVERWRITE
Radim Blazek
blazek at itc.it
Tue Nov 30 10:09:00 EST 2004
New GRASS users are usually surprised that most GRASS modules silently
or with warning overwrite existing maps. Most normal users
however like this feature (AFAIK).
Some modules have -o (overwrite) option ( e.g. r.composite, g.copy ).
For vector maps it is possible to set OVERWRITE variable to 0
to disable overwriting but default (if not set) is 1 (overwrite).
My suggestion is:
1) use OVERWRITE GRASS variable also in G_open_cell_new,
if OVERWRITE=0 and raster exists G_open_cell_new will call
G_fatal_error (?, not sure)
2) change OVERWRITE default value to 0 (don't overwrite)
3) Add a new function G_force_overwrite which can force
overwriting even if OVERWRITE=0. Modules with -o flag can use
if ( flag_o->answer )
G_force_overwrite();
before calling G_open_cell_new
Radim
More information about the grass-dev
mailing list