[GRASS-dev] r65348: Mapset's tmp dir placement and broken element search

Glynn Clements glynn at gclements.plus.com
Thu Jun 11 07:06:57 PDT 2015


Martin Landa wrote:

> > There is no justification for the current behaviour. The temporary
> > cell/fcell and null files should always be created in the mapset's
> > temporary directory.
> 
> I am not sure why it must be so on (if files are not on the same
> filesystem, they can be copied),

A copy is very different from rename(). It's not just about
performance for performance' sake, but for minimising the interval
when maps are corrupt (i.e. files exist in an inconsistent state).

> anyway I changed it in r65436. GRASS_TMPDIR_MAPSET is accepted only
> by vector library. Martin

Martin Landa wrote:

> the question is whether to rename this variable to
> GRASS_VECTOR_TMPDIR_MAPSET. Any opinion? Martin

Allowing "normal" tempfiles to be placed elsewhere is reasonable
enough. But G_tempfile() originally existed specifically for the
tempfile-and-rename idiom, and some code requires that behaviour
(there are many more cases which ought to use that but don't).

Given that "misuse" of G_tempfile() (i.e. using it like tmpnam()) is
now more common than its intended use, it wouldn't be unreasonable to
make G_tempfile() use the new behaviour and use a different name for
the previous behaviour. The only requirement is that some function
continues to provide the previous behaviour

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list