#2116: r.kappa: call to r.stats fails if spaces in path
-------------------------+--------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Default | Version: svn-releasebranch64
Keywords: kappa path | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Comment(by hamish):
Replying to [ticket:2116 mlennert]:
> The attached patch solves the problem for me, but I imagine that
> there is a more elegant solution.
right, we should use G_vspawn_ex() instead of system(). It's already done
for r.kappa in G7; just needs to be backported & tested. see r40146 and
r44964.
In addition, as a minor style tweak/simplification I'd suggest to consider
using the r.stats output= file option instead of a shell redirect/dealing
with the stdout pipe.
#2116: r.kappa: call to r.stats fails if spaces in path
---------------------------+------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa, path | Platform: Unspecified
Cpu: Unspecified |
---------------------------+------------------------------------------------
Comment(by mlennert):
Replying to [comment:3 hamish]:
> simple quoting fix committed in devbr6 & relbr64 with r58111,2.
>
> it should be tested in wingrass before closing the ticket, see the
i.smap help page for an example.
Thanks a lot ! I hadn't applied the patch, yet, since you suggested
G_vspawn_ex(), and I didn't find the time to look into that. Should that
solution be preferred ? Should we maybe leave the ticket open as a
reminder, or should we just say that if it works in windows we're happy
with this quick fix for grass6 ?
#2116: r.kappa: call to r.stats fails if spaces in path
---------------------------+------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa, path | Platform: Unspecified
Cpu: Unspecified |
---------------------------+------------------------------------------------
Comment(by glynn):
Replying to [comment:4 mlennert]:
> I hadn't applied the patch, yet, since you suggested G_vspawn_ex(), and
I didn't find the time to look into that. Should that solution be
preferred ?
The spawn functions are preferable (that's what r.kappa uses in 7.0), as
they avoid the shell altogether.
#2116: r.kappa: call to r.stats fails if spaces in path
---------------------------+------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa, path | Platform: Unspecified
Cpu: Unspecified |
---------------------------+------------------------------------------------
Comment(by neteler):
Replying to [comment:5 glynn]:
> Replying to [comment:4 mlennert]:
>
> > I hadn't applied the patch, yet, since you suggested G_vspawn_ex(),
and I didn't find the time to look into that. Should that solution be
preferred ?
>
> The spawn functions are preferable (that's what r.kappa uses in 7.0), as
they avoid the shell altogether.
Backported to 6.5 in r60121 and to 6.4 in r60122. The result is identical
7.0.
Replying to [comment:6 neteler]:
> Replying to [comment:5 glynn]:
> > Replying to [comment:4 mlennert]:
> >
> > > I hadn't applied the patch, yet, since you suggested G_vspawn_ex(),
and I didn't find the time to look into that. Should that solution be
preferred ?
> >
> > The spawn functions are preferable (that's what r.kappa uses in 7.0),
as they avoid the shell altogether.
>
> Backported to 6.5 in r60121 and to 6.4 in r60122. The result is
identical 7.0.
>
> Please test on Windows and close if solved.
Just tested on Windows 7 Virtual Machine with
WinGRASS-6.4.4svn-r60212-962-Setup.exe (yesterday's build) and GISDBASE
containing "GRASS DATA": it seems to work perfectly.