Ticket #629 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

WinGRASS: spaces in pathnames

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 6.4.0
Component: Installation Version: 6.4.0 RCs
Keywords: wingrass, msys Cc:
Platform: MSWindows XP CPU: x86-32

Description

Hi,

trying the native stand-alone installer (rev37703) installed in C:\Program Files\GRASS GIS\GRASS-6-SVN to expose/fix some missing quoting.

The icon to start the wxPython GUI directly works, but the Cmd> prompt fails for v.db.select roads where="label ~ 'highway'" with:

Bad file descriptor: Files/GRASS

The "GRASS with MSYS" icon doesn't get very far at all due to msys bugs:

in msys.bat :startrxvt section the line

if NOT EXIST %WD%rxvt.exe goto startsh

needs to have %WD%rxvt.exe "quoted" otherwise you get this error in the terminal window: (but it continues anyway)

The system cannot find the path specified.

a few lines later in if NOT "x%*" == "x" start %WD%rxvt -backspacekey ... -e /bin/sh --login -c "%*" it fails with a pop up window:

Windows cannot find 'C:\Program'. Make sure you typed the name correctly, ...

if you "quote" %WD%rxvt it then gives the error that it can not find the program -backspacekey, Make sure that you typed the name correctly, ....

maybe using a newer msys package helps fix these? if not, time to report some bugs to them.


also, the grass dirname in msys/etc/fstab needs to be quoted? (do that in mswindows/GRASS-Installer.nsi)

knock these things off one by one... Hamish

Attachments

abort_on_spaces.diff Download (1.9 KB) - added by hamish 5 years ago.
msys.bat patch
msys.bat Download (7.0 KB) - added by cnielsen 5 years ago.
updated to convert filepaths to space-less style
GRASS-Installer.patch Download (0.8 KB) - added by cnielsen 5 years ago.
Fixes path with space issue with startup shortcuts
db_start_debug.patch Download (1.1 KB) - added by marisn 5 years ago.
This patch should work - we need more info why spawn is failing

Change History

  Changed 5 years ago by hamish

also I notice the C:/Program Files/GRASS GIS/GRASS-6-SVN/msys/grass/ dir is empty.

  Changed 5 years ago by hamish

more links:

- bug roundup:  https://sourceforge.net/search/?group_artifact_id=102435&type_of_search=artifact&group_id=2435&words=spaces

- patch for -backspacekey bug:  https://sourceforge.net/tracker/index.php?func=detail&aid=1840961&group_id=2435&atid=102435

- solve fstab spaces with DOSified pathname: dir /x or batch code:  https://sourceforge.net/tracker/index.php?func=detail&aid=1087569&group_id=2435&atid=202435

- mailing list discussion  http://www.nabble.com/make-target---dependency-names-with-spaces-td22997327.html

after the "start" patch in msys.bat and changing the pathname to C:/PROGRA~1/GRASSG~1/GRASS-6-SVN in msys/etc/fstab, then I can successfully start the wxPython GUI.

Hamish

in reply to: ↑ description ; follow-up: ↓ 5   Changed 5 years ago by glynn

Replying to hamish:

trying the native stand-alone installer (rev37703) installed in C:\Program Files\GRASS GIS\GRASS-6-SVN to expose/fix some missing quoting. The icon to start the wxPython GUI directly works, but the Cmd> prompt fails for v.db.select roads where="label ~ 'highway'" with:

Bad file descriptor: Files/GRASS

This one isn't an MSys issue, as MSys shouldn't be involved in running the wxPython GUI, or in running commands from it.

Did the shlex fix make it into the version which you're testing?

in reply to: ↑ 4   Changed 5 years ago by hamish

Replying to hamish:

The icon to start the wxPython GUI directly works, but the Cmd> prompt fails for v.db.select roads where="label ~ 'highway'" with:

 Bad file descriptor: Files/GRASS

Replying to glynn:

This one isn't an MSys issue, as MSys shouldn't be involved in running the wxPython GUI, or in running commands from it. Did the shlex fix make it into the version which you're testing?

yes.

I also notice that error after fixes to msys.bat I start grass + msys terminal from C:\Program Files\GRASS GIS\...

looking trough "set" I don't see anything obviously broken.

running v.db.select roads from the msys command line with DEBUG=5 it shows that it gets up to

D2/5: opendir c:/Program Files/GRASS GIS/GRASS-6-SVN\driver\db\

(slash directions verbatim)

then it locks up the msys terminal.

that debug message comes from lib/db/dbmi_base/dbmscap.c

Hamish

  Changed 5 years ago by hamish

Hi,

the msys maintainers have decided to reject patches that correct spaces-in-pathnames bugs. i.e. installations to C:\Program Files\... just got that much harder.

 https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1511614&group_id=2435

Hamish

follow-up: ↓ 8   Changed 5 years ago by cnielsen

Bad news about the spaces...

In the new wingrass release (6.4.0rc5 later today) I've updated msys.bat to:

... start "MSYS 1.0" "%WD%rxvt" ...

I can't think of a way the "dir /x" fix could be used within the installer to adjust things to the 8.3 path names, but if someone else can I'll implement it.

The empty grass dir is a mount point for the install directory and allows the grass with msys shortcuts to be executed with msys.bat /grass/bin/grass64 -wxpython etc. I tried quotes in the fstab file but it doesn't work, which means that the grass with msys shortcuts won't work either if installed in a path with spaces.

in reply to: ↑ 7   Changed 5 years ago by hamish

Replying to cnielsen:

I can't think of a way the "dir /x" fix could be used within the installer to adjust things to the 8.3 path names, but if someone else can I'll implement it. The empty grass dir is a mount point for the install directory

yeah I realized that after posting,

and allows the grass with msys shortcuts to be executed with msys.bat /grass/bin/grass64 -wxpython etc.

I don't really understand that.

I tried quotes in the fstab file but it doesn't work, which means that the grass with msys shortcuts won't work either if installed in a path with spaces.

it is the fstab file that needs the PROGRA~1 style because it uses whitespace as the column deliminator and has no quoting ability.

Hamish

  Changed 5 years ago by hamish

see also #637.

Changed 5 years ago by hamish

msys.bat patch

  Changed 5 years ago by hamish

Hi,

attached is a patch against the latest CVS version of msys.bat which fixes some of the quoting issues. You'll have to rem out the "abort if spaces in pathname" if you want to allow that.

Colin re. fstab: as with %WD% in the patch, maybe you can use %~dps0 to get the 8.3 shortname string somehow?  http://www.robvanderwoude.com/ntfor.php

Hamish

  Changed 5 years ago by hamish

re.

Bad file descriptor: Files/GRASS

source:grass/trunk/lib/db/dbmi_base/dbmscap.c@#L171

?

Hamish

Changed 5 years ago by cnielsen

updated to convert filepaths to space-less style

follow-up: ↓ 13   Changed 5 years ago by cnielsen

Replying to hamish:

attached is a patch against the latest CVS version of msys.bat which fixes some of the quoting issues. You'll have to rem out the "abort if spaces in pathname" if you want to allow that.

As written it seems to abort whether there are spaces in the pathname or not, I just tried it in c:\program files\ and c:\programs\ with the same result. I think I've fixed it, see attached file (I've just attached msys.bat not a patch. I could figure out svn diff for the CVS of msys.bat...).

There's two bugs, one was your typo (hamish), the other I think is a bug in the original msys.bat. Anyway, it successfully converts the path to 8.3 format.

Replying to hamish:

Replying to cnielsen:

and allows the grass with msys shortcuts to be executed with msys.bat /grass/bin/grass64 -wxpython etc.

I don't really understand that.

Replying to hamish:

Colin re. fstab: as with %WD% in the patch, maybe you can use %~dps0 to get the 8.3 shortname string somehow?  http://www.robvanderwoude.com/ntfor.php

fstab is only needed for the "Grass with msys" shortcuts to work. They work by calling msys.bat with the argument /grass/bin/grass64 -wxpython (see the attached msys.bat lines 97 & 98. To fix this for spaces we have two options though I'm not sure which will work.

1) fstab is written by the installer script with the install path, but I can't find a way to get the nsi script to convert the path with %~dps0 before writing the fstab file.

2) If we can get msys.bat to convert a windows path (from an argument) from (eg):

c:\Program Files\Grass\bin\grass64 -wxpython

to:

/c/Program\ Files/Grass/bin/grass64 -wxpython

then we wouldn't need fstab at all. The shortcut would use the windows style path, and msys.bat would convert it into readable format for msys.bat line 98

in reply to: ↑ 12 ; follow-up: ↓ 14   Changed 5 years ago by hamish

Replying to cnielsen:

As written it seems to abort whether there are spaces in the pathname or not, I just tried it in c:\program files\ and c:\programs\ with the same result. I think I've fixed it, see attached file

thanks for catching that.

(I've just attached msys.bat not a patch. I could figure out svn diff for the CVS of msys.bat...).

cvs -d:pserver:anonymous@mingw.cvs.sourceforge.net:/cvsroot/mingw login 
cvs -z3 -d:pserver:anonymous@mingw.cvs.sourceforge.net:/cvsroot/mingw co -P msys/dvlpr/

# make changes

cvs -u diff msys/dvlpr/bin/msys.bat > patch.diff

There's two bugs, one was your typo (hamish),

yup

the other I think is a bug in the original msys.bat.

yeah, that was noted by the original patch's author on SourceForge?, disregarded as harmless.

Anyway, it successfully converts the path to 8.3 format.

cool

see the attached msys.bat lines 97 & 98.

this: ?

+if "x%*" == "x" start [...] -e /bin/sh --login -i
+if NOT "x%*" == "x" start [...] -e /bin/sh --login -c "%*"

does batch logic know "else"?

should I send that patch upstream?

1) fstab is written by the installer script with the install path, but I can't find a way to get the nsi script to convert the path with %~dps0 before writing the fstab file.

any link to Nsi script help? seems like a fairly developed language; might have a system{} command.

2) If we can get msys.bat to convert a windows path (from an argument) from (eg): c:\Program Files\Grass\bin\grass64 -wxpython to: /c/Program\ Files/Grass/bin/grass64 -wxpython then we wouldn't need fstab at all. The shortcut would use the windows style path, and msys.bat would convert it into readable format for msys.bat line 98

GRASS-Installer.nsi has code for that already?

source:grass/trunk/mswindows/GRASS-Installer.nsi@#L577

Hamish

in reply to: ↑ 13 ; follow-up: ↓ 15   Changed 5 years ago by hamish

Replying to hamish:

any link to Nsi script help? seems like a fairly developed language; might have a system{} command.

maybe "Exec" + some FOR /F ... SET UNIXPATH=~dps0 style DOS magic?  http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.2

in reply to: ↑ 14 ; follow-up: ↓ 16   Changed 5 years ago by cnielsen

Replying to hamish:

maybe "Exec" + some FOR /F ... SET UNIXPATH=~dps0 style DOS magic?  http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.2

No luck so far, I managed to have the NSI script write a little batch file, which in turn writes the 8.3 shortname to a system variable with SETX. This value is then written to the fstab value, however it always writes the previous value of the variable instead... annoying. Also it is not really preferable to have a system environment variable permanently written for this purpose...

GRASS-Installer.nsi has code for that already?

True but msys still has problems with "/c/Program\ Files/GRASS/bin/grass64" as it strips out the \.

On another similar note, I had an error with v.digit failing to write to the dbf because the GIS Database path had a space in it (which is the default in the installer).

in reply to: ↑ 15   Changed 5 years ago by marisn

Replying to cnielsen:

On another similar note, I had an error with v.digit failing to write to the dbf because the GIS Database path had a space in it (which is the default in the installer).

I commited to 6.5 a hack that was sitting in my commit queue for some time. Please test r38898

follow-up: ↓ 18   Changed 5 years ago by jef

In case someone is not aware:

we use  GetShortPathName() in QGIS' GRASS plugin to eliminate blanks from (some) filenames and paths on Windows.

And NSIS has  GetFullPathName /SHORT

Changed 5 years ago by cnielsen

Fixes path with space issue with startup shortcuts

in reply to: ↑ 17 ; follow-ups: ↓ 19 ↓ 21   Changed 5 years ago by cnielsen

Replying to jef:

In case someone is not aware: And NSIS has  GetFullPathName /SHORT

I wasn't aware, thanks jef. Patch for GRASS-Installer.nsi attached.

Replying to marisn:

I commited to 6.5 a hack that was sitting in my commit queue for some time. Please test r38898

I tried this out and got "cannot open driver dbf". Below are the relevant errors I think.

D2/3: c_table_definition()
D3/3: c_create_bgcmd()
cat integer 
D2/3: c_create_table() field = 1 key = cat cols = cat integer 
D1/3: Vect_default_field_info(): map = test3 field = 1
D2/3: drv = dbf db = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
D2/3: driver = dbf, database = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
D2/3: opendir c:/Programs/GIS/OSGeo4W/apps/grass/grass-6.5.svn\driver\db\

Invalid argument: can't _spawnl
WARNING: Cannot open driver dbf

in reply to: ↑ 18 ; follow-up: ↓ 20   Changed 5 years ago by marisn

Replying to cnielsen:

Replying to marisn:

I commited to 6.5 a hack that was sitting in my commit queue for some time. Please test r38898

I tried this out and got "cannot open driver dbf". Below are the relevant errors I think. {{{ D2/3: c_table_definition() D3/3: c_create_bgcmd() cat integer D2/3: c_create_table() field = 1 key = cat cols = cat integer D1/3: Vect_default_field_info(): map = test3 field = 1 D2/3: drv = dbf db = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ D2/3: driver = dbf, database = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ D2/3: opendir c:/Programs/GIS/OSGeo4W/apps/grass/grass-6.5.svn\driver\db\ Invalid argument: can't _spawnl WARNING: Cannot open driver dbf }}}

Please apply patch I attached to this ticked and report results. It will not fix issue, but hopefully provide aditional information.

in reply to: ↑ 19   Changed 5 years ago by cnielsen

Replying to marisn:

Please apply patch I attached to this ticked and report results. It will not fix issue, but hopefully provide aditional information.

The patch failed to compile

start.c: In function `db_start_driver':
start.c:224: error: too many arguments to function `db_syserror'
make: *** [OBJ.i686-pc-mingw32/start.o] Error 1

Changed 5 years ago by marisn

This patch should work - we need more info why spawn is failing

in reply to: ↑ 18 ; follow-up: ↓ 22   Changed 5 years ago by hellik

Invalid argument: can't _spawnl WARNING: Cannot open driver dbf

grass64.svn rev 39432 compiled in osgeo4w-stack WinVista?32 tested in nc-dataset

v.out.ogr with spaces in path:

(Wed Oct 07 22:58:02 2009) v.out.ogr input=poi_names_wake@PERMANENT type=point dsn=C:\wd\test ogr olayer=poi_names_wake_out Invalid argument: can't _spawnl ERROR: Unable to start driver <dbf> (Wed Oct 07 22:58:02 2009) Command finished (0 sec)

=> shape-file is exported, but empty

v.out.ogr with no spaces in path: v.out.ogr input=poi_names_wake@PERMANENT type=point dsn=C:\wd\test_ogr olayer=poi_names_wake_out2 Invalid argument: can't _spawnl ERROR: Unable to start driver <dbf> (Wed Oct 07 23:05:24 2009) Command finished (0 sec)

=> shape-file is exported, but empty

in reply to: ↑ 21 ; follow-up: ↓ 23   Changed 5 years ago by hellik

Replying to hellik:

Invalid argument: can't _spawnl WARNING: Cannot open driver dbf

grass64.svn rev 39432 compiled in osgeo4w-stack WinVista?32

new location:

g.region -p projection: 99 (Transverse Mercator) zone: 0 datum: towgs84=577.326,90.129,463.919,5.1366,1.4742,5.297,2.4232 ellipsoid: bessel north: 2500 south: 2000 west: 500 east: 1000 nsres: 20 ewres: 20 rows: 25 cols: 25 cells: 625

new dem generated by r.surf.fractal

r.to.vect -s -v input=testdem@test output=testdemvect feature=area              
Raster is not CELL, '-v' flag ignored, raster values will be written to the table.
Invalid argument: can't _spawnl
Unable to start driver <dbf>
ERROR: Unable to open database <$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/> by driver <dbf>

in reply to: ↑ 22   Changed 5 years ago by hellik

Replying to hellik:

Replying to hellik:

Invalid argument: can't _spawnl WARNING: Cannot open driver dbf

grass64.svn rev 39432 compiled in osgeo4w-stack, WinVista?32 nc-dataset

g.copy vect=hospitals@PERMANENT,testhospitals2                                  
Copy vector <hospitals@PERMANENT> to current mapset as <testhospitals2>
Invalid argument: can't _spawnl
Unable to start driver <dbf>
Unable to copy table <testhospitals2>
Cannot copy <hospitals@PERMANENT> to current mapset as <testhospitals2>

follow-up: ↓ 25   Changed 5 years ago by neteler

There should be new debug output available if activated:

Please try for us:

g.gisenv set="DEBUG=2"
g.copy vect=hospitals@PERMANENT,testhospitals2

in reply to: ↑ 24   Changed 5 years ago by hellik

Replying to neteler:

There should be new debug output available if activated: Please try for us: {{{ g.gisenv set="DEBUG=2" g.copy vect=hospitals@PERMANENT,testhospitals2 }}}

g.gisenv set="DEBUG=2"

g.copy vect=hospitals@PERMANENT,copy_hospital                                   
Copy vector <hospitals@PERMANENT> to current mapset as <copy_hospital>
D2/2: Copy vector 'hospitals' in 'PERMANENT' to
'copy_hospital'
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/coor to C:\gisdata\grassdata/nc_spm_08/user1/vector
/copy_hospital/coor
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/head to C:\gisdata\grassdata/nc_spm_08/user1/vector
/copy_hospital/head
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/hist to C:\gisdata\grassdata/nc_spm_08/user1/vector
/copy_hospital/hist
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/topo to C:\gisdata\grassdata/nc_spm_08/user1/vector
/copy_hospital/topo
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/cidx to C:\gisdata\grassdata/nc_spm_08/user1/vector
/copy_hospital/cidx
D1/2: Vect_open_old(): name = hospitals mapset= PERMANENT
update = 0
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: dig_spidx_init()
D1/2: open format file: 'PERMANENT/vector/hospitals/frmt'
D1/2: Vector format: 0 (native)
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Vect__read_head(): vector = hospitals@PERMANENT
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Level request = 1
D1/2: Vect_open_old(): vector opened on level 1
D1/2: Vect_read_dblinks(): map = hospitals, mapset =
PERMANENT
D1/2: dbln file: C:\gisdata\grassdata/nc_spm_08/PERMANENT/ve
ctor/hospitals/dbln
D1/2: dbln: 1 hospitals cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D1/2: field = 1 name = (null), table = hospitals, key = cat,
database = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, driver =
dbf
D1/2: Dblinks read
D1/2: Vect_open_old(): name = copy_hospital mapset= user1
update = 1
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: dig_spidx_init()
D1/2: open format file: 'user1/vector/copy_hospital/frmt'
D1/2: Vector format: 0 (native)
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Vect__read_head(): vector = copy_hospital@user1
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Level request = 0
D1/2: Vect_open_topo(): name = copy_hospital mapset= user1
D1/2: get coor info: C:\gisdata\grassdata/nc_spm_08/user1/ve
ctor/copy_hospital/coor
D1/2: Info->size = 4654, Info->mtime = 1255041550
D2/2: Topo header: file version 5.0 , supported from GRASS
version 5.0
D2/2:   byte order 0
D2/2:   header size 142
D2/2:   with_z 0
D2/2:   coor size 4654
D1/2: Topo head: coor size = 4654, coor mtime = 0
D1/2: dig_load_plus()
D1/2: dig_spidx_init()
D2/2: Topo header: file version 5.0 , supported from GRASS
version 5.0
D2/2:   byte order 0
D2/2:   header size 142
D2/2:   with_z 0
D2/2:   coor size 4654
D2/2: Vect_cidx_open(): name = copy_hospital mapset= user1
D1/2: Vect_open_old(): vector opened on level 2
D1/2: Vect_read_dblinks(): map = copy_hospital, mapset =
user1
D1/2: dbln file: C:\gisdata\grassdata/nc_spm_08/user1/vector
/copy_hospital/dbln
D1/2: Cannot open vector database definition file
D1/2: Vect_get_dblink(): link = 0
D1/2: Vect_default_field_info(): map = copy_hospital field =
1
D2/2: drv = dbf db = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
D1/2: Vect_write_dblinks(): map = copy_hospital, mapset =
user1
D1/2: dbln file: C:\gisdata\grassdata/nc_spm_08/user1/vector
/copy_hospital/dbln
D1/2: 1 copy_hospital cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D1/2: Dblinks written
D2/2: opendir
c:/OSGeo4W/apps/grass/grass-6.4.0svn\driver\db\
D2/2: dbmi_client/start startup:
"c:/OSGeo4W/apps/grass/grass-6.4.0svn\driver\db\dbf.exe"
Invalid argument: can't _spawnl
Unable to start driver <dbf>
Unable to copy table <copy_hospital>
D1/2: Vect_close(): name = hospitals, mapset = PERMANENT,
format = 0, level = 1
D1/2: close history file
D1/2: Vect_close(): name = copy_hospital, mapset = user1,
format = 0, level = 2
D1/2: close history file
Cannot copy <hospitals@PERMANENT> to current mapset as <copy_hospital>

follow-up: ↓ 27   Changed 5 years ago by hamish

hellik wrote:

D2/2: opendir c:/OSGeo4W/apps/grass/grass-6.4.0svn\driver\db\
D2/2: dbmi_client/start startup: "c:/OSGeo4W/apps/grass/grass-6.4.0svn\driver\db\dbf.exe"
Invalid argument: can't _spawnl
Unable to start driver <dbf>

G_convert_dirseps_to_host() added in r39450-2.

see  http://thread.gmane.org/gmane.comp.gis.grass.user/31623/focus=31758 (ummm Markus, was that only committed locally?)

If that doesn't work, my next guess is that the leading and trailing \" are being treated as a literal part of the program name. (?!)

Hamish

in reply to: ↑ 26   Changed 5 years ago by hellik

Replying to hamish:

G_convert_dirseps_to_host() added in r39450-2.

grass64svn_relb self compiled in osgeo4w in WinVista?: rev39452

GISDBASE='C:\gisdata\grassdata';
LOCATION_NAME='nc_spm_08';
MAPSET='user1';
DEBUG='2';
GRASS_GUI='wxpython';
g.copy vect=hospitals@PERMANENT,testcopyhospital                                
Copy vector <hospitals@PERMANENT> to current mapset as <testcopyhospital>
D2/2: Copy vector 'hospitals' in 'PERMANENT' to
'testcopyhospital'
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/coor to C:\gisdata\grassdata/nc_spm_08/user1/vector
/testcopyhospital/coor
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/head to C:\gisdata\grassdata/nc_spm_08/user1/vector
/testcopyhospital/head
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/hist to C:\gisdata\grassdata/nc_spm_08/user1/vector
/testcopyhospital/hist
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/topo to C:\gisdata\grassdata/nc_spm_08/user1/vector
/testcopyhospital/topo
D2/2: copy C:\gisdata\grassdata/nc_spm_08/PERMANENT/vector/h
ospitals/cidx to C:\gisdata\grassdata/nc_spm_08/user1/vector
/testcopyhospital/cidx
D1/2: Vect_open_old(): name = hospitals mapset= PERMANENT
update = 0
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: dig_spidx_init()
D1/2: open format file: 'PERMANENT/vector/hospitals/frmt'
D1/2: Vector format: 0 (native)
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Vect__read_head(): vector = hospitals@PERMANENT
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Level request = 1
D1/2: Vect_open_old(): vector opened on level 1
D1/2: Vect_read_dblinks(): map = hospitals, mapset =
PERMANENT
D1/2: dbln file: C:\gisdata\grassdata/nc_spm_08/PERMANENT/ve
ctor/hospitals/dbln
D1/2: dbln: 1 hospitals cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D1/2: field = 1 name = (null), table = hospitals, key = cat,
database = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, driver =
dbf
D1/2: Dblinks read
D1/2: Vect_open_old(): name = testcopyhospital mapset= user1
update = 1
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: dig_spidx_init()
D1/2: open format file: 'user1/vector/testcopyhospital/frmt'
D1/2: Vector format: 0 (native)
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Vect__read_head(): vector = testcopyhospital@user1
D1/2: Vect_set_thresh(): thresh = 0.000000
D1/2: Level request = 0
D1/2: Vect_open_topo(): name = testcopyhospital mapset=
user1
D1/2: get coor info: C:\gisdata\grassdata/nc_spm_08/user1/ve
ctor/testcopyhospital/coor
D1/2: Info->size = 4654, Info->mtime = 1255092687
D2/2: Topo header: file version 5.0 , supported from GRASS
version 5.0
D2/2:   byte order 0
D2/2:   header size 142
D2/2:   with_z 0
D2/2:   coor size 4654
D1/2: Topo head: coor size = 4654, coor mtime = 0
D1/2: dig_load_plus()
D1/2: dig_spidx_init()
D2/2: Topo header: file version 5.0 , supported from GRASS
version 5.0
D2/2:   byte order 0
D2/2:   header size 142
D2/2:   with_z 0
D2/2:   coor size 4654
D2/2: Vect_cidx_open(): name = testcopyhospital mapset=
user1
D1/2: Vect_open_old(): vector opened on level 2
D1/2: Vect_read_dblinks(): map = testcopyhospital, mapset =
user1
D1/2: dbln file: C:\gisdata\grassdata/nc_spm_08/user1/vector
/testcopyhospital/dbln
D1/2: Cannot open vector database definition file
D1/2: Vect_get_dblink(): link = 0
D1/2: Vect_default_field_info(): map = testcopyhospital
field = 1
D2/2: drv = dbf db = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
D1/2: Vect_write_dblinks(): map = testcopyhospital, mapset =
user1
D1/2: dbln file: C:\gisdata\grassdata/nc_spm_08/user1/vector
/testcopyhospital/dbln
D1/2: 1 testcopyhospital cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D1/2: Dblinks written
D2/2: dbDbmscap(): opendir
[c:\OSGeo4W\apps\grass\grass-6.4.0svn\driver\db\]
D2/2: dbmi_client/start startup:
["c:\OSGeo4W\apps\grass\grass-6.4.0svn\driver\db\dbf.exe"]
Invalid argument: can't _spawnl
Unable to start driver <dbf>
Unable to copy table <testcopyhospital>
D1/2: Vect_close(): name = hospitals, mapset = PERMANENT,
format = 0, level = 1
D1/2: close history file
D1/2: Vect_close(): name = testcopyhospital, mapset = user1,
format = 0, level = 2
D1/2: close history file
Cannot copy <hospitals@PERMANENT> to current mapset as <testcopyhospital>

follow-up: ↓ 30   Changed 5 years ago by hamish

ok, it looks like the extra \" may be to blame then. (if _spawnl() quotes the argument [as it should] then you get ""...\dbf.exe"")

I'll reply here once a fix for that is submitted.

Hamish

follow-up: ↓ 31   Changed 5 years ago by hamish

extra quotes removed in r39456,7. try, try again....

in reply to: ↑ 28   Changed 5 years ago by glynn

Replying to hamish:

ok, it looks like the extra \" may be to blame then. (if _spawnl() quotes the argument [as it should] then you get ""...\dbf.exe"")

 Microsoft's documentation says that the caller needs to quote arguments:

Spaces embedded in strings may cause unexpected behavior; for example, passing _spawn the string "hi there" will result in the new process getting two arguments, "hi" and "there". If the intent was to have the new process open a file named "hi there", the process would fail. You can avoid this by quoting the string: "\"hi there\"".

However: it says "arguments", which doesn't necessarily apply to the command name (and db_start_driver() invokes the driver with no arguments), although it will apply to argv[0] (it shouldn't matter if argv[0] has excess quotes, but if it doesn't have enough it will end up rolling over into argv[1]).

in reply to: ↑ 29 ; follow-up: ↓ 32   Changed 5 years ago by hellik

Replying to hamish:

extra quotes removed in r39456,7. try, try again....

grass64svn_relb self compiled in osgeo4w in WinVista?: rev39464

g.gisenv --v                                                                    
GISDBASE='C:\gisdata\grassdata';
LOCATION_NAME='nc_spm_08';
MAPSET='user1';
DEBUG='0';
GRASS_GUI='wxpython';
g.copy vect=hospitals@PERMANENT,copyhospital                                    
Copy vector <hospitals@PERMANENT> to current mapset as <copyhospital>

seems to work :o)

best regards helli

in reply to: ↑ 31   Changed 5 years ago by hellik

Replying to hellik:

Replying to hamish:

extra quotes removed in r39456,7. try, try again....

grass64svn_relb self compiled in osgeo4w in WinVista?: rev39464 {{{ g.gisenv --v GISDBASE='C:\gisdata\grassdata'; LOCATION_NAME='nc_spm_08'; MAPSET='user1'; DEBUG='0'; GRASS_GUI='wxpython'; }}} seems to work :o)

update: tested also now in the sqlite-mapset of nc-dataset with sqlite as the db-backend

g.gisenv --v                                                                    
GISDBASE='C:\gisdata\grassdata';
LOCATION_NAME='nc_spm_08';
MAPSET='sqlite';
GRASS_GUI='wxpython';
g.copy vect=hospitals@PERMANENT,hospitalsqlite                                  
Copy vector <hospitals@PERMANENT> to current mapset as <hospitalsqlite>

seems to also to work

best regards helmut

  Changed 5 years ago by neteler

I can confirm that the "can't _spawnl" problem is gone (using the latest winGRASS binary based on r39626).

  Changed 5 years ago by hamish

see also #809

  Changed 5 years ago by hamish

  • status changed from new to closed
  • resolution set to fixed

closing this bug as in general this lot seem to be taken care of and before it morphs into the next set of windows bugs. those can start their own, new tickets.

  Changed 5 years ago by hamish

local copy of msys.bat with quoted variables committed to mswindows/osgeo4w/ in r40817-9.

Note: See TracTickets for help on using tickets.