[GRASS-dev] r.mapcalc and g.remove --v/q issues

Glynn Clements glynn at gclements.plus.com
Thu Oct 12 12:38:31 EDT 2006

Maciej Sieczka wrote:

> > 2. Some files found, none removed.
> "ERROR: Raster map <dummy> found, but none of it's components could be
> removed:
> (here comes the list)"
> > 3. Some files found, some removed.
> "ERROR: Raster map <dummy> found, but only the following components
> where removed:
> (here comes the list)
> The following components couldn't be removed:
> (here comes the list)"

These aren't quite that simple. If you are removing multiple maps, you
probably don't want to abort at the first error, but remove as much as
you can.

As GRASS errors are always fatal, you would have to generate a warning
for each map then generate a single error at the end.

> > 4. Some files found, all removed.
> "WARNING: Raster map <dummy> removed"

This needs to be a message, not a warning.

> > If it fails to remove some components of a map, it's necessary for the
> > user to be told the details, IMHO, as the user is going to have to fix
> > the problem manually.
> I agree. But the situation #2 or #3 is quite unlikely - one would need
> to lose his write access for some files that make the given GRASS
> raster map, while retaining his write acces to it's other components
> (is there a possible scenario for this within GRASS?). Or he would have
> to corrupt his raster map by removing some of it's components manually,
> outside the GRASS.

On Unix, to remove a file, you need write access on the directory; you
don't need any access on the file itself (although, if the directory
has the sticky bit, you need to own either the file or the

Windows adds the additional requirement that the file isn't open.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list