Opened 11 years ago
Closed 11 years ago
#2116 closed defect (fixed)
r.kappa: call to r.stats fails if spaces in path
Reported by: | mlennert | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 6.4.4 |
Component: | Raster | Version: | svn-releasebranch64 |
Keywords: | r.kappa, path | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description (last modified by )
To reproduce with GISDBASE="GRASS DATA":
r.kappa classification=landclass96@PERMANENT reference=landuse96_28m@PERMANENT Sorry <DATA/nc_spm_08/user1/.tmp/moritz/31976.0> is not a valid option
The attached patch solves the problem for me, but I imagine that there is a more elegant solution.
Moritz
Attachments (1)
Change History (8)
by , 11 years ago
Attachment: | kappa_rstats.diff added |
---|
comment:1 by , 11 years ago
Replying to 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.
regards, Hamish
comment:2 by , 11 years ago
on the other hand, for choosing the path of least change in the stable branch your patch might be the way to go.
follow-up: 4 comment:3 by , 11 years ago
Component: | Default → Raster |
---|---|
Description: | modified (diff) |
Keywords: | r.kappa added; kappa removed |
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.
Hamish
follow-up: 5 comment:4 by , 11 years ago
Replying to 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 ?
Moritz
follow-up: 6 comment:5 by , 11 years ago
Replying to 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.
follow-up: 7 comment:6 by , 11 years ago
Replying to glynn:
Replying to 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.
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to neteler:
Replying to glynn:
Replying to 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.
Closing.
Moritz
patch for grass64release