[GRASS-dev] [GRASS GIS] #1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------
wxgui g.mremove called on vector with * wildcard does not work:

{{{
(Tue Sep 14 15:24:09 2010)
g.mremove -f vect=map*
Removing vector <mapBloomday_Olive_11set10_Avg>
Unable to delete file
'C:\cygwin\home\andy/latlong/luigi/vector/mapBloomday_Olive_11set10_Avg/hist'
couldn't be removed
<mapBloomday_Olive_11set10_Avg> nothing removed
(Tue Sep 14 15:24:10 2010) Command finished (0 sec)
}}}

wxgui g.mremove called with full vector name works fine:

{{{
(Tue Sep 14 15:27:01 2010)
g.mremove -f vect=mapBloomday_Olive_11set10_Avg
Removing vector <mapBloomday_Olive_11set10_Avg>
(Tue Sep 14 15:27:01 2010) Command finished (0 sec)
}}}

There was only that vector map starting with map* in current location.

Deleting rasters with g.mremove works fine both ways.

Trying same test with an old (May 29) WinGRASS-6.4.svn installed on the
same machine;

Wildcards work:

{{{
(Tue Sep 14 15:49:46 2010)
g.mremove -f vect=map*
Removing vector <mapBloomday_Olive_11set10_Avg>
(Tue Sep 14 15:49:47 2010) Command finished (1 sec)

}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by hellik):

Replying to [ticket:1158 lponti]:
> wxgui g.mremove called on vector with * wildcard does not work:

I can confirm this (WinVista23-box).

but it's very interesting:

a first run of

{{{
g.mremove -f vect=map*
}}}

gets following

{{{
Unable to delete file
'C:\cygwin\home\andy/latlong/luigi/vector/mapBloomday_Olive_11set10_Avg/hist'
}}}

there seems to be a problem with the hist-section of the Grass-vector-
data-structure.

but in a second run of

{{{
g.mremove -f vect=map*
}}}

all vector maps marked by the *-wildcard are deleted.

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by hellik):

Replying to [comment:1 hellik]:
> Replying to [ticket:1158 lponti]:
> > wxgui g.mremove called on vector with * wildcard does not work:
>
> I can confirm this (WinVista23-box).
>
> but it's very interesting:
>
> a first run of
>
> {{{
> g.mremove -f vect=map*
> }}}
>
> gets following
>
> {{{
> Unable to delete file
'C:\cygwin\home\andy/latlong/luigi/vector/mapBloomday_Olive_11set10_Avg/hist'
> }}}
>
> there seems to be a problem with the hist-section of the Grass-vector-
data-structure.
>
> but in a second run of
>
> {{{
> g.mremove -f vect=map*
> }}}
>
> all vector maps marked by the *-wildcard are deleted.
>
> Helmut

tested also with the latest wingrass65-nightly build. there also you need
two runs of g.mremove -f to remove a vector map.

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by glynn):

Replying to [comment:1 hellik]:

> but in a second run of

> all vector maps marked by the *-wildcard are deleted.

Vect_open_old_head() is called if the dbln file exists. After deleting the
table, the map is closed. Then all files are deleted from the directory.

I think that Vect_close() isn't closing all of the files, causing the
unlink() to fail on Windows (on Unix, you can delete open files; on
Windows, you can't).

I note that the history file is opened for both native and OGR maps, but
is only closed for native maps. But I don't think that's the issue.

What would be an issue is if the database driver inherits the descriptor
for the hist file, and is still running when Vect_delete() tries to delete
the history file. I note that db_table_exists() doesn't shut down the
driver if it returns an error indication.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by hellik):

Replying to [comment:2 hellik]:
> Replying to [comment:1 hellik]:
> > Replying to [ticket:1158 lponti]:
> > > wxgui g.mremove called on vector with * wildcard does not work:
> >
> > I can confirm this (WinVista23-box).
> >
> > but it's very interesting:
> >
> > a first run of
> >
> > {{{
> > g.mremove -f vect=map*
> > }}}
> >
> > gets following
> >
> > {{{
> > Unable to delete file
'C:\cygwin\home\andy/latlong/luigi/vector/mapBloomday_Olive_11set10_Avg/hist'
> > }}}
> >
> > there seems to be a problem with the hist-section of the Grass-vector-
data-structure.
> >
> > but in a second run of
> >
> > {{{
> > g.mremove -f vect=map*
> > }}}
> >
> > all vector maps marked by the *-wildcard are deleted.
> >
> > Helmut
>
> tested also with the latest wingrass65-nightly build. there also you
need two runs of g.mremove -f to remove a vector map.
>
> Helmut

also tested in a self built WinGrass7, this issue can be confirmed also be
there.

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by lponti):

I was wondering whether this is actually a normal priority ticket. I gave
it normal just because it is the default, but sounds like a fairly
important command is affected. WinGRASS has been doing so much better
recently, and I believe wild card-based removal of vector is an important
component of GRASS shell scripts.

I routinely use a series of shell scripts that include the following GRASS
commnands: g.parser, g.mapset, g.region, g.copy, g.mremove, v.in.ascii,
v.extract, v.to.rast, v.proj, v.db.addcol, v.what.rast, v.voronoi,
v.category, v.surf.idw, r.mapcalc, r.colors, r.report, r.univar, d.erase,
d.rast, d.vect, d.his, d.grid, d.legend, d.text, d.mon, d.histogram.

Kind regards,

Luigi

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by hamish):

are wildcards from `g.mlist` working?

how about `g.remove vect=` for a single vector map?

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1158#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by lponti):

Replying to [comment:6 hamish]:
> are wildcards from `g.mlist` working?

Using self built (noticed that http://josef.fsv.cvut.cz/wingrass/ has not
been updated in the last few days) releasebranch_6_4 revision: 43598. In
North Carolina location, mapset user1:

{{{
GRASS 6.4> g.mlist type=vect pattern="bus*"
busroute1
busroute11
busroute6
busroute_a
busroutesall
busstopsall
}}}

>
> how about `g.remove vect=` for a single vector map?

It works:

{{{
GRASS 6.4> g.copy vect=busroute1,routebus1
Copy vector <busroute1@PERMANENT> to current mapset as <routebus1>

GRASS 6.4> g.remove vect=routebus1
Removing vector <routebus1>
}}}

It works with g.mremove -f with wildcard too:

{{{
GRASS 6.4> g.copy vect=busroute1,routebus1
Copy vector <busroute1@PERMANENT> to current mapset as <routebus1>

GRASS 6.4> g.mremove -f vect=route*
Removing vector <routebus1>
}}}

Has it been changed since 6.4.0-1? I assumed nothing had changed since the
ticket was unmodified. Last report was from Helmut who confirmed about
nine days ago in winGRASS 7.

Thanks,

Luigi

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by lponti):

Still having the same issue using recent svn snapshopts: g.mremove needs
to be run twice when used with wildcards to remove vectors.

I have g.mremove in a cleanup routine inside a bash script

{{{
cleanup()
{
         # Remove temp directory.
         \rm -rf $DIRTMP
         # Remove temp text files.
         \rm -f ~/clipRegion.txt
         #[...]
         # Remove gis temp files in latlong location
         g.mremove -f vect=map*
         #[...]
}
}}}

Currently using GRASS from installer WinGRASS-6.4.SVN-r43880-1-Setup.exe

Any hints appreciated. Thanks and regards,

Luigi

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------
Changes (by lponti):

  * priority: normal => major

Comment:

This also happens every time I use a command that has vector output using
the --overwrite flag, and the output vector already exists, e.g.:

{{{
g.copy vect=streets_wake_large,streets_wake_large_tmp
}}}

First attempt does not work:

{{{
(Thu Oct 28 19:43:11 2010)
v.select --overwrite ainput=streets_wake_large
binput=census_extract_all_trt2000 output=streets_wake_large_tmp
Vector map <streets_wake_large_tmp> already exists and will be overwritten
Unable to delete file
'C:\cygwin\home\andy/nc_spm_08/user1/vector/streets_wake_large_tmp/hist'
ERROR: Unable to delete vector map <streets_wake_large_tmp>
(Thu Oct 28 19:43:11 2010) Command finished (0 sec)
}}}

Second try is fine:

{{{
(Thu Oct 28 19:43:33 2010)
v.select --overwrite ainput=streets_wake_large
binput=census_extract_all_trt2000 output=streets_wake_large_tmp
Vector map <streets_wake_large_tmp> already exists and will be overwritten
Processing features...
Processing areas...
Writing selected features...
Sto scrivendo gli attributi
Building topology for vector map <streets_wake_large_tmp>...
Registering primitives...
76 primitives registered
388 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 77
Number of primitives: 76
Number of points: 0
Number of lines: 76
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.select completo.
(Thu Oct 28 19:43:35 2010) Command finished (1 sec)
}}}

Maybe it is an issue of the OS: anybody able to reproduce it on XP? (I
used same settings as my previous comment.)

Exactly the same thing happens when using g.remove on
streets_wake_large_tmp as you need to run the command twice.

This would mean that the problem is not the wildcards.

I am changing priority to major because being unable to remove vectors
seems a serious issue. Please, provide feedback on this.

Kind regards,

Luigi

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by glynn):

Replying to [comment:9 lponti]:

I note that there haven't been any responses to comment:9.

I don't think that anything is going to happen on this until someone fires
up a debugger and confirms or refutes that.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by glynn):

Replying to [comment:10 glynn]:

> I note that there haven't been any responses to comment:9.

Oops. I mean comment:3.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by lponti):

Replying to [comment:11 glynn]:
> Replying to [comment:10 glynn]:
>
> > I note that there haven't been any responses to comment:9.
>
> Oops. I mean comment:3.

Thanks Glynn, and sorry for the inconvenience. I understand that reporting
the same bug over and over is not going to fix it. Please, indicate if I
can be of any further help or I should just be patient (and quiet).
(Thanks for your patience and guidance along these years of GRASS
learning.)

Luigi

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by hellik):

Replying to [comment:10 glynn]:
> Replying to [comment:9 lponti]:
>
> I note that there haven't been any responses to comment:9.
>
> I don't think that anything is going to happen on this until someone
fires up a debugger and confirms or refutes that.

{{{
g.list type=vect mapset=deletevectors
----------------------------------------------
vector Dateien im Mapset <deletevectors> vorhanden:
busroute1 busroute2 busroute3
}}}

first run

{{{
g.mremove -f vect=bus*
Entferne vector <busroute1>.
'vector/busroute1' wurde in mehreren Mapsets gefunden (auch gefunden in
<PERMANENT>).
Verwende <busroute1@deletevectors>
D3/3: Delete vector 'busroute1'
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute1/dbln
D1/3: Vect_open_old(): name = busroute1 mapset=
deletevectors update = 0
D1/3: Vect_set_thresh(): thresh = 0.000000
D3/3: dig_init_plus()
D1/3: dig_spidx_init()
D3/3: dig_cidx_init()
D1/3: open format file:
'deletevectors/vector/busroute1/frmt'
D1/3: Vector format: 0 (native)
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Vect__read_head(): vector = busroute1@deletevectors
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Level request = 1
D1/3: Vect_open_old(): vector opened on level 1
D1/3: Vect_read_dblinks(): map = busroute1, mapset =
deletevectors
D3/3: Searching for FID column in OGR DB
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute1/dbln
D1/3: dbln: 1 busroute1 cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D3/3: Field number <1>, name <(null)>
D3/3: Vect_check_dblink: field 1
D1/3: field = 1 name = (null), table = busroute1, key = cat,
database = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, driver =
dbf
D1/3: Dblinks read
D1/3: Vect_get_dblink(): link = 0
D3/3: Vect_subst_var(): in =
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, map = busroute1,
mapset = deletevectors
D3/3: -> C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D3/3: Delete drv:db:table 'dbf:C:\gisdata\grassdata/nc_spm_0
8/deletevectors/dbf/:busroute1'
D3/3: db_start_driver_open_database():
   drvname = dbf, dbname =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: dbDbmscap(): opendir [c:\Program
Files\GRASS-64-SVN\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
""c:\Program Files\GRASS-64-SVN\driver\db\dbf.exe""
D2/3: DBF: db__driver_open_database() name =
'C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/'
D2/3: db.name =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: add_table(): table = busroute1 name = busroute1.dbf
D2/3: add_table(): table = busroute2 name = busroute2.dbf
D2/3: add_table(): table = busroute3 name = busroute3.dbf
D2/3: table = busroute1 -> busroute1
D2/3: save_table 0
D2/3: save_table 1
D2/3: save_table 2
D3/3: db_delete_table(): driver = dbf, db =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/, table =
busroute1
D2/3: dbDbmscap(): opendir [c:\Program
Files\GRASS-64-SVN\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
""c:\Program Files\GRASS-64-SVN\driver\db\dbf.exe""
D2/3: DBF: db__driver_open_database() name =
'C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/'
D2/3: db.name =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: add_table(): table = busroute1 name = busroute1.dbf
D2/3: add_table(): table = busroute2 name = busroute2.dbf
D2/3: add_table(): table = busroute3 name = busroute3.dbf
D3/3: drop table busroute1
D3/3: SQL statement parsed successfully: drop table
busroute1
D2/3: find_table(): table = busroute1
D2/3: ? busroute1
D2/3: load_table_head(): tab = 0, C:\gisdata\grassdata/nc_sp
m_08/deletevectors/dbf//busroute1.dbf
D2/3: ncols = 2
D2/3: DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = cat, width =
11, decimals = 0
D2/3: DBFFieldType 0
D3/3: add_column(): tab = 0, type = 1, name = ROUTE, width =
5, decimals = 0
D3/3: Doing SQL command <2> on DBF table... (see
include/sqlp.h)
D2/3: save_table 0
D2/3: save_table 1
D2/3: save_table 2
D1/3: Vect_close(): name = busroute1, mapset =
deletevectors, format = 0, level = 1
D1/3: close history file
D3/3: opendir 'C:\gisdata\grassdata/nc_spm_08/deletevectors/
vector/busroute1'
D3/3: file = '.'
D3/3: file = '..'
D3/3: file = 'cidx'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute1/cidx'
D3/3: file = 'coor'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute1/coor'
D3/3: file = 'dbln'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute1/dbln'
D3/3: file = 'head'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute1/head'
D3/3: file = 'hist'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute1/hist'
D3/3: file = 'topo'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute1/topo'
D3/3: rename 'C:\gisdata\grassdata/nc_spm_08/deletevectors/v
ector/busroute1' to
'C:\gisdata\grassdata/nc_spm_08/deletevectors/.tmp/3728.0'
D3/3: remove directory
'C:\gisdata\grassdata/nc_spm_08/deletevectors/.tmp/3728.0'
Entferne vector <busroute2>.
D3/3: Delete vector 'busroute2'
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute2/dbln
D1/3: Vect_open_old(): name = busroute2 mapset=
deletevectors update = 0
D1/3: Vect_set_thresh(): thresh = 0.000000
D3/3: dig_init_plus()
D1/3: dig_spidx_init()
D3/3: dig_cidx_init()
D1/3: open format file:
'deletevectors/vector/busroute2/frmt'
D1/3: Vector format: 0 (native)
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Vect__read_head(): vector = busroute2@deletevectors
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Level request = 1
D1/3: Vect_open_old(): vector opened on level 1
D1/3: Vect_read_dblinks(): map = busroute2, mapset =
deletevectors
D3/3: Searching for FID column in OGR DB
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute2/dbln
D1/3: dbln: 1 busroute2 cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D3/3: Field number <1>, name <(null)>
D3/3: Vect_check_dblink: field 1
D1/3: field = 1 name = (null), table = busroute2, key = cat,
database = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, driver =
dbf
D1/3: Dblinks read
D1/3: Vect_get_dblink(): link = 0
D3/3: Vect_subst_var(): in =
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, map = busroute2,
mapset = deletevectors
D3/3: -> C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D3/3: Delete drv:db:table 'dbf:C:\gisdata\grassdata/nc_spm_0
8/deletevectors/dbf/:busroute2'
D3/3: db_start_driver_open_database():
   drvname = dbf, dbname =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: dbDbmscap(): opendir [c:\Program
Files\GRASS-64-SVN\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
""c:\Program Files\GRASS-64-SVN\driver\db\dbf.exe""
D2/3: DBF: db__driver_open_database() name =
'C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/'
D2/3: db.name =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: add_table(): table = busroute2 name = busroute2.dbf
D2/3: add_table(): table = busroute3 name = busroute3.dbf
D2/3: table = busroute2 -> busroute2
D2/3: save_table 0
D2/3: save_table 1
D3/3: db_delete_table(): driver = dbf, db =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/, table =
busroute2
D2/3: dbDbmscap(): opendir [c:\Program
Files\GRASS-64-SVN\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
""c:\Program Files\GRASS-64-SVN\driver\db\dbf.exe""
D2/3: DBF: db__driver_open_database() name =
'C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/'
D2/3: db.name =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: add_table(): table = busroute2 name = busroute2.dbf
D2/3: add_table(): table = busroute3 name = busroute3.dbf
D3/3: drop table busroute2
D3/3: SQL statement parsed successfully: drop table
busroute2
D2/3: find_table(): table = busroute2
D2/3: ? busroute2
D2/3: load_table_head(): tab = 0, C:\gisdata\grassdata/nc_sp
m_08/deletevectors/dbf//busroute2.dbf
D2/3: ncols = 2
D2/3: DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = cat, width =
11, decimals = 0
D2/3: DBFFieldType 0
D3/3: add_column(): tab = 0, type = 1, name = ROUTE, width =
5, decimals = 0
D3/3: Doing SQL command <2> on DBF table... (see
include/sqlp.h)
D2/3: save_table 0
D2/3: save_table 1
D1/3: Vect_close(): name = busroute2, mapset =
deletevectors, format = 0, level = 1
D1/3: close history file
D3/3: opendir 'C:\gisdata\grassdata/nc_spm_08/deletevectors/
vector/busroute2'
D3/3: file = '.'
D3/3: file = '..'
D3/3: file = 'cidx'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute2/cidx'
D3/3: file = 'coor'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute2/coor'
D3/3: file = 'dbln'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute2/dbln'
D3/3: file = 'head'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute2/head'
D3/3: file = 'hist'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute2/hist'
Kann Datei
'C:\gisdata\grassdata/nc_spm_08/deletevectors/vector/busroute2/hist' nicht
löschen.
konnte nicht entfernt werden.
<busroute2> nichts gelöscht.
Entferne vector <busroute3>.
D3/3: Delete vector 'busroute3'
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute3/dbln
D1/3: Vect_open_old(): name = busroute3 mapset=
deletevectors update = 0
D1/3: Vect_set_thresh(): thresh = 0.000000
D3/3: dig_init_plus()
D1/3: dig_spidx_init()
D3/3: dig_cidx_init()
D1/3: open format file:
'deletevectors/vector/busroute3/frmt'
D1/3: Vector format: 0 (native)
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Vect__read_head(): vector = busroute3@deletevectors
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Level request = 1
D1/3: Vect_open_old(): vector opened on level 1
D1/3: Vect_read_dblinks(): map = busroute3, mapset =
deletevectors
D3/3: Searching for FID column in OGR DB
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute3/dbln
D1/3: dbln: 1 busroute3 cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D3/3: Field number <1>, name <(null)>
D3/3: Vect_check_dblink: field 1
D1/3: field = 1 name = (null), table = busroute3, key = cat,
database = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, driver =
dbf
D1/3: Dblinks read
D1/3: Vect_get_dblink(): link = 0
D3/3: Vect_subst_var(): in =
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, map = busroute3,
mapset = deletevectors
D3/3: -> C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D3/3: Delete drv:db:table 'dbf:C:\gisdata\grassdata/nc_spm_0
8/deletevectors/dbf/:busroute3'
D3/3: db_start_driver_open_database():
   drvname = dbf, dbname =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: dbDbmscap(): opendir [c:\Program
Files\GRASS-64-SVN\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
""c:\Program Files\GRASS-64-SVN\driver\db\dbf.exe""
D2/3: DBF: db__driver_open_database() name =
'C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/'
D2/3: db.name =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: add_table(): table = busroute3 name = busroute3.dbf
D2/3: table = busroute3 -> busroute3
D2/3: save_table 0
D3/3: db_delete_table(): driver = dbf, db =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/, table =
busroute3
D2/3: dbDbmscap(): opendir [c:\Program
Files\GRASS-64-SVN\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
""c:\Program Files\GRASS-64-SVN\driver\db\dbf.exe""
D2/3: DBF: db__driver_open_database() name =
'C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/'
D2/3: db.name =
C:\gisdata\grassdata/nc_spm_08/deletevectors/dbf/
D2/3: add_table(): table = busroute3 name = busroute3.dbf
D3/3: drop table busroute3
D3/3: SQL statement parsed successfully: drop table
busroute3
D2/3: find_table(): table = busroute3
D2/3: ? busroute3
D2/3: load_table_head(): tab = 0, C:\gisdata\grassdata/nc_sp
m_08/deletevectors/dbf//busroute3.dbf
D2/3: ncols = 2
D2/3: DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = cat, width =
11, decimals = 0
D2/3: DBFFieldType 0
D3/3: add_column(): tab = 0, type = 1, name = ROUTE, width =
5, decimals = 0
D3/3: Doing SQL command <2> on DBF table... (see
include/sqlp.h)
D2/3: save_table 0
D1/3: Vect_close(): name = busroute3, mapset =
deletevectors, format = 0, level = 1
D1/3: close history file
D3/3: opendir 'C:\gisdata\grassdata/nc_spm_08/deletevectors/
vector/busroute3'
D3/3: file = '.'
D3/3: file = '..'
D3/3: file = 'cidx'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute3/cidx'
D3/3: file = 'coor'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute3/coor'
D3/3: file = 'dbln'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute3/dbln'
D3/3: file = 'head'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute3/head'
D3/3: file = 'hist'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute3/hist'
Kann Datei
'C:\gisdata\grassdata/nc_spm_08/deletevectors/vector/busroute3/hist' nicht
löschen.
konnte nicht entfernt werden.
<busroute3> nichts gelöscht.
}}}

second run

{{{
g.mremove -f vect=bus*
Entferne vector <busroute2>.
D3/3: Delete vector 'busroute2'
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute2/dbln
D3/3: opendir 'C:\gisdata\grassdata/nc_spm_08/deletevectors/
vector/busroute2'
D3/3: file = '.'
D3/3: file = '..'
D3/3: file = 'hist'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute2/hist'
D3/3: file = 'topo'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute2/topo'
D3/3: rename 'C:\gisdata\grassdata/nc_spm_08/deletevectors/v
ector/busroute2' to
'C:\gisdata\grassdata/nc_spm_08/deletevectors/.tmp/7964.0'
D3/3: remove directory
'C:\gisdata\grassdata/nc_spm_08/deletevectors/.tmp/7964.0'
Entferne vector <busroute3>.
D3/3: Delete vector 'busroute3'
D1/3: dbln file: C:\gisdata\grassdata/nc_spm_08/deletevector
s/vector/busroute3/dbln
D3/3: opendir 'C:\gisdata\grassdata/nc_spm_08/deletevectors/
vector/busroute3'
D3/3: file = '.'
D3/3: file = '..'
D3/3: file = 'hist'
D3/3: delete file 'C:\gisdata\grassdata/nc_spm_08/deletevect
ors/vector/busroute3/hist'
Kann Datei
'C:\gisdata\grassdata/nc_spm_08/deletevectors/vector/busroute3/hist' nicht
löschen.
konnte nicht entfernt werden.
<busroute3> nichts gelöscht.
}}}

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by glynn):

Replying to [comment:13 hellik]:

> > I don't think that anything is going to happen on this until someone
fires up a debugger and confirms or refutes that.

Setting DEBUG= won't be enough. Someone will need to use gdb to track
what's actually going on. I.e. when the hist file is opened, and when it
gets closed. Setting breakpoints on open() and fclose() (not a typo; the
hist file is opened with G_fopen_*, which use open()+fdopen(), but closed
with fclose()).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by hellik):

Replying to [comment:14 glynn]:
> Replying to [comment:13 hellik]:
>
> > > I don't think that anything is going to happen on this until someone
fires up a debugger and confirms or refutes that.
>
> Setting DEBUG= won't be enough. Someone will need to use gdb to track
what's actually going on. I.e. when the hist file is opened, and when it
gets closed. Setting breakpoints on open() and fclose() (not a typo; the
hist file is opened with G_fopen_*, which use open()+fdopen(), but closed
with fclose()).

any hints for setting breakpoints? in the wiki
(http://grass.osgeo.org/wiki/GRASS_Debugging#Using_GDB) there aren't any
hints.

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard in WinGRASS-6.4.0-1
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by lutra):

> how about `g.remove vect=` for a single vector map?

it doesn't work, see

http://lists.osgeo.org/pipermail/grass-user/2010-November/058600.html

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard on Windows + needs to be used twice
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard on Windows + needs to be used twice
----------------------------------+-----------------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------+-----------------------------------------

Comment(by neteler):

From #1210: To delete a vector map from a mapset I have to do the
operation twice (OSGeo4W)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#1158: g.mremove fails when used with wildcard on Windows + needs to be used twice
--------------------------------------------+-------------------------------
Reporter: lponti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: wingrass, g.mremove, wildcards | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------+-------------------------------
Changes (by hellik):

  * keywords: g.mremove, wildcards => wingrass, g.mremove, wildcards

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1158#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>