[GRASS-dev] Re: what if: a new GRASS directory layout?

Glynn Clements glynn at gclements.plus.com
Wed Apr 9 16:32:00 EDT 2008


Ivan Shmakov wrote:

> 	It seems that the reasonable behaviour would be to make a
> 	back-reference if possible, and issue a warning if not.

A warning isn't sufficent. If the GC relies upon back-references, but
you can't create one, the data could disappear while a process is
trying to use it.

Essentially, if you can't ensure that the back-references can be
created, you can't design a GC which relies upon them.

> 	* no such mirroring is currently possible precisely due to that
> 	  some files may be updated in place; thus, I believe the ``in
> 	  place'' issue has to be resolved irrespective to whether the
> 	  proposed scheme will be accepted as a whole or not.

I agree with this point at least.

Regardless of the layout, the API will need to change. In particular,
there would need to be a distinction between creating a support file
for a new map, and replacing the support file for an existing map.

In all cases, any functions which open elements for writing will need
a matching close function to atomically replace any existing file with
the new version.

Fortunately, there isn't a lot of direct file output outside of the
libraries:

grass=> select a.object, a.symbol
        from obj_imp a, obj_exp b
        where a.symbol = b.symbol
        and b.object in ('lib/gis/OBJ.i686-pc-linux-gnu/open.o', 'lib/gis/OBJ.i686-pc-linux-gnu/open_misc.o')
        and b.symbol not like '%\\_old%'
        and a.object not like 'lib/%'
        ;
                              object                              |      symbol      
------------------------------------------------------------------+------------------
 general/manage/lib/OBJ.i686-pc-linux-gnu/copyfile.o              | G_open_new
 general/g.mapsets/OBJ.i686-pc-linux-gnu/main_cmd.o               | G_fopen_new
 imagery/i.fft/OBJ.i686-pc-linux-gnu/save_fft.o                   | G_fopen_new_misc
 imagery/i.ortho.photo/libes/OBJ.i686-pc-linux-gnu/fopen_camera.o | G_fopen_append
 imagery/i.ortho.photo/libes/OBJ.i686-pc-linux-gnu/fopen_camera.o | G_fopen_new
 imagery/i.ortho.photo/libes/OBJ.i686-pc-linux-gnu/open_camera.o  | G_open_new
 raster/r.reclass/OBJ.i686-pc-linux-gnu/reclass.o                 | G_fopen_new
 raster/r.null/OBJ.i686-pc-linux-gnu/null.o                       | G_open_new_misc
 raster/r.flow/OBJ.i686-pc-linux-gnu/io.o                         | G_open_new
 raster/r.flow/OBJ.i686-pc-linux-gnu/io.o                         | G_open_update
 raster/r.support/front/OBJ.i686-pc-linux-gnu/front.o             | G_open_new_misc
 raster3d/r3.mkdspf/OBJ.i686-pc-linux-gnu/main.o                  | G_fopen_new
 vector/v.external/OBJ.i686-pc-linux-gnu/main.o                   | G_fopen_new
 vector/v.out.ascii/OBJ.i686-pc-linux-gnu/out.o                   | G_fopen_new
 vector/v.support/OBJ.i686-pc-linux-gnu/main.o                    | G_fopen_modify
 vector/v.label/OBJ.i686-pc-linux-gnu/main.o                      | G_fopen_new
 vector/v.lrs/v.lrs.label/OBJ.i686-pc-linux-gnu/main.o            | G_fopen_new

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


More information about the grass-dev mailing list