[GRASS-dev] g.copy vect/DBF problem & suggestion

Hi,

copying a vector map into a mapset where the DBF driver
is defined but the dbf/ directory still absent (for
whatsoever reason), g.copy bails out with

g.copy vect=zipcodes_wake,myzipcodes_wake
Copy vector <zipcodes_wake@PERMANENT> to current mapset as
<myzipcodes_wake>
DBMI-DBF driver error:
Cannot open dbf database: /home/neteler/grassdata/nc_spm_04/neteler/dbf/

WARNUNG: Cannot open database
         '/home/neteler/grassdata/nc_spm_04/neteler/dbf/'
no database is open
WARNUNG: Cannot copy table
WARNUNG: Cannot copy <zipcodes_wake@PERMANENT> to current mapset as
         <myzipcodes_wake>

In db/drivers/dbf/db.c, I suggest to add a test around line 89 with
# pseudocode
if LOCATION/MAPSET/dbf/ does not exist
   create it

How to implement this in a portable way?

Markus

Markus Neteler wrote on 04/26/2007 12:23 AM:

Hi,

copying a vector map into a mapset where the DBF driver
is defined but the dbf/ directory still absent (for
whatsoever reason), g.copy bails out with

g.copy vect=zipcodes_wake,myzipcodes_wake
Copy vector <zipcodes_wake@PERMANENT> to current mapset as
<myzipcodes_wake>
DBMI-DBF driver error:
Cannot open dbf database: /home/neteler/grassdata/nc_spm_04/neteler/dbf/

WARNUNG: Cannot open database
         '/home/neteler/grassdata/nc_spm_04/neteler/dbf/'
no database is open
WARNUNG: Cannot copy table
WARNUNG: Cannot copy <zipcodes_wake@PERMANENT> to current mapset as
         <myzipcodes_wake>

In db/drivers/dbf/db.c, I suggest to add a test around line 89 with
# pseudocode
if LOCATION/MAPSET/dbf/ does not exist
   create it

How to implement this in a portable way?
  

Inspired by lib/gis/ code, I have now submitted a fix for this.
diff attached.

Markus

------------------
ITC -> dall'1 marzo 2007 Fondazione Bruno Kessler
ITC -> since 1 March 2007 Fondazione Bruno Kessler
------------------

(attachments)

db.diff (1.14 KB)