Hi,
I would like to check if the file defined as output in a python script
already exists and fire an error when it exists and the overwrite flag is
not set. Furhtermore I'd like
to check this already in the beginning before all calculations in the
script are executed. I thought about something like:
output = options['output']
if (grass.find_file(name = output, element = 'cell')['file'] and
grass.read_command("g.gisenv", get = "GRASS_OVERWRITE")!=1):
grass.fatal(_("Output file exists already, either change output
name or set overwrite-flag"))
but what is the correct way to get the information if the overwrite flag is
set
or not for that script? The GRASS-OVERWRITE variable is not set although
the script is launched with --overwrite. So how to get this info?
/Johannes
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user