[GRASS5] Inconsistencies among modules

Markus Neteler neteler at itc.it
Thu Aug 9 04:19:33 EDT 2001


On Wed, Aug 08, 2001 at 09:06:39PM -0500, Helena wrote:
> Frank Warmerdam wrote:
> 
> > Helena wrote:
> >
> > >Frank Warmerdam wrote:
> > >
> > >>Rich Shepard wrote:
> > >>
> > >>> Two inconsistencies I've picked up:
> > >>>
> > >>> 1)  Some modules (e.g., r.in.gdal, r.patch) allow the use of an existing
> > >>>output file name with no warning that that file already exists, and asking
> > >>>the user if it's OK to overwrite it. Other modules (e.g., r.poly, v.digit)
> > >>>tell the user that the output file name exists, does not ask for directions,
> > >>>and refuses to let the user overwrite it. Recommendation: always check,
> > >>>always ask, follow the user's directions.
> > >>>
> > >>Folks,
> > >>
> > >>What would the normal mechanism be to ask the user if they want to overwrite
> > >>an existing raster layer?
> > >>
> > >
> > >r.mapcalc does it the right way, most of other programs don't
> > >
> > >mapcalc> diff=owhusle-owhusle.rst
> > >diff - already exists. ok to overwrite? (y/n)
> > >
> >
> > Folks,
> >
> > For reference, r.mapcalc only prompts if it is in interactive mode, which it
> > determines using "interactive = isatty(0)".  It uses
> > "G_find_file ("cell",result,G_mapset())" to test if the raster already
> > exists,
> > and G_yes() to test for a user response.
> >
> > I presume it just overwrites silently if not in interactive mode.
> >
> > As someone (email already deleted!) pointed out, G_parser() actually
> > does this
> > sort of existance test if it prompts for the raster name, but not if
> > supplied on
> > the command line.  Should we look at fixing G_parser() to check for command
> > line arguments too instead of trying to build alot of logic into each
> > program?
> >
> > If so, should we leave this for post 5.0? I hate to make dramatic system
> > wide
> > changes shortly before a release.
> 
> definitely for post 5.0 This is not the kind of change that should be done now.
> 
> Helena

I agree... Another thing to consider is that the modules shall
not query when used in scripted mode. Otherwise the automatisation
would be broken. Definitly a 5.1 issue.

Rich, other, if possible, look into

documents/parameter_proposal.txt

the mentioned overwrite story is already described there.

Markus



More information about the grass-dev mailing list