[GRASS-dev] db/drivers/dbf/tables.c contains call to 'mv'

Glynn Clements glynn at gclements.plus.com
Tue Feb 20 12:18:33 EST 2007


Moritz Lennert wrote:

> On lines 313 and 324 db/drivers/dbf/tables.c contains a call to 'mv'. This
> fails under Windows as the command cannot be found.
> 
> There is a #ifdef __MINGW32__ between the two calls. If this becomes true,
> do we still need the mv calls ?

IMHO, that code (and the strikingly similar code in close_new() in
lib/gis/closecell.c) is bogus. It should just be using rename().

The link() + remove() idiom may have been to deal with breakage on
NFS, where rename() may not be atomic[1], but link() always is. Given
that you shouldn't be performing multiple concurrent operations in a
single mapset directory[2], I don't see this as an important
consideration.

[1] One of the reasons why NFS is often thought to stand for
"Not a File System", as it violates a number of important Unix
filesystem semantics.

[2] Most GRASS database (gisdbase) operations *aren't* performed
atomically.

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




More information about the grass-dev mailing list