[GRASS-dev] [GRASS GIS] #898: WinGrass: r.out.xyz error

#898: WinGrass: r.out.xyz error
------------------------------------+---------------------------------------
Reporter: hellik | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: svn-releasebranch64
Keywords: wingrass, raster, path | Platform: MSWindows Vista
      Cpu: x86-32 |
------------------------------------+---------------------------------------
self-compild WinGrass r40741 in osgeo4w-stack

{{{
r.out.xyz --verbose input=elevation@PERMANENT output=C:\wd\mg\elev.xyz
D2/3: filename =
c:/OSGeo4W/apps/grass/grass-6.4.0svn/scripts/r.out.xyz
D2/3: set GIS_OPT_INPUT=elevation@PERMANENT
D2/3: set GIS_OPT_OUTPUT=C:wdmgelev.xyz
D2/3: set GIS_OPT_FS=|
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
"C:/OSGeo4W/apps/msys/bin/sh
c:/OSGeo4W/apps/grass/grass-6.4.0svn/scripts/r.out.xyz
@ARGS_PARSED@"
c:/OSGeo4W/apps/grass/grass-6.4.0svn/scripts/r.out.xyz: line
61: C:wdmgelev.xyz: Permission denied
D1/3: ret = 1
}}}

there seems a path problem with the output-file.

Helmut

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

#898: WinGrass: r.out.xyz error
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: svn-releasebranch64
Resolution: | Keywords: wingrass, raster, path
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by glynn):

Replying to [ticket:898 hellik]:
> self-compild WinGrass r40741 in osgeo4w-stack
>
{{{
r.out.xyz --verbose input=elevation@PERMANENT output=C:\wd\mg\elev.xyz
}}}

Are you running this via the MSys shell or via cmd.exe?

The MSys shell interprets backslashes, so they need to be escaped:
{{{
r.out.xyz --verbose input=elevation@PERMANENT output=C:\\wd\\mg\\elev.xyz
}}}
or quoted:
{{{
r.out.xyz --verbose input=elevation@PERMANENT output='C:\wd\mg\elev.xyz'
}}}
In most situations, you can use a forward slash instead:
{{{
r.out.xyz --verbose input=elevation@PERMANENT output=C:/wd/mg/elev.xyz
}}}

OTOH, if you're running the command via cmd.exe (Windows' own command
prompt), this would be a bug.

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

#898: WinGrass: r.out.xyz error
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: svn-releasebranch64
Resolution: | Keywords: wingrass, raster, path
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by hellik):

Replying to [comment:1 glynn]:
> Replying to [ticket:898 hellik]:
> > self-compild WinGrass r40741 in osgeo4w-stack
> >
> {{{
> r.out.xyz --verbose input=elevation@PERMANENT output=C:\wd\mg\elev.xyz
> }}}
>
> Are you running this via the MSys shell or via cmd.exe?

starting point was the wx-gui which didn't work and from which the
original error message comes. then i've tried the command from the wx-gui
in the msys-shell and the same error message comes up.

>
> The MSys shell interprets backslashes, so they need to be escaped:
> {{{
> r.out.xyz --verbose input=elevation@PERMANENT
output=C:\\wd\\mg\\elev.xyz
> }}}

working in the msys-shell

> or quoted:
> {{{
> r.out.xyz --verbose input=elevation@PERMANENT output='C:\wd\mg\elev.xyz'
> }}}

working in the msys-shell

> In most situations, you can use a forward slash instead:
> {{{
> r.out.xyz --verbose input=elevation@PERMANENT output=C:/wd/mg/elev.xyz
> }}}

working in the msys-shell

>
> OTOH, if you're running the command via cmd.exe (Windows' own command
prompt), this would be a bug.

Helmut

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

#898: WinGrass: r.out.xyz error
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: svn-releasebranch64
Resolution: | Keywords: wingrass, raster, path
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by hamish):

Does this command work: (from the MSys terminal prompt)

{{{
  r.stats -1gn elevation > C:\wd\mg\elev.xyz
}}}

?

also, I seem to recall that MS Windows generally prefers you use "double"
quotes for quoting. (for msys it shouldn't matter, but for a DOS-in-a-box
it could)

Hamish

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

#898: WinGrass: r.out.xyz error
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: svn-releasebranch64
Resolution: | Keywords: wingrass, raster, path
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by hellik):

Replying to [comment:1 glynn]:
> Replying to [ticket:898 hellik]:
> > self-compild WinGrass r40741 in osgeo4w-stack
> >
> {{{
> r.out.xyz --verbose input=elevation@PERMANENT output=C:\wd\mg\elev.xyz
> }}}
>
> Are you running this via the MSys shell or via cmd.exe?

also tested in the actual daily WinGrass-build
(http://josef.fsv.cvut.cz/wingrass/grass64/) via cmd.exe which the
original r.out.xyz --verbose input=elevation@PERMANENT
output=C:\wd\mg\elev.xyz, but this also fails in the cmd.exe

Helmut

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

#898: WinGrass: r.out.xyz error
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: svn-releasebranch64
Resolution: | Keywords: wingrass, raster, path
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by hellik):

Replying to [comment:3 hamish]:
> Does this command work: (from the MSys terminal prompt)
>
>
> {{{
> r.stats -1gn elevation > C:\wd\mg\elev.xyz
> }}}
>
> ?

in the msys-shell

{{{
GRASS 6.4> r.stats -1gn elevation > C:\wd\mg\elev.xyz
sh: C:wdmgelev.xyz: Permission denied
}}}

but

{{{
GRASS 6.4> r.stats -1gn elevation > "C:\wd\mg\elev.xyz"
  100%
}}}

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

#898: WinGrass: r.out.xyz error
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: svn-releasebranch64
Resolution: invalid | Keywords: wingrass, raster, path
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Changes (by hamish):

  * status: new => closed
  * resolution: => invalid

Comment:

{{{
msys GRASS 6.4> ls C:\Temp\*
ls: C:Temp*: No such file or directory
}}}

the problem is that "\" has special meaning in a bourne shell, so when
used litterally needs to be quoted. What you have done is quoted the w, m,
and e characters in your filename and so the resulting string is
C:wdmgelev.xyz, and apparently you don't have permission to write to your
C:\ directory from that user account.

this should work without "quotes":
{{{
GRASS 6.4> r.stats -1gn elevation > C:\\wd\\mg\\elev.xyz
}}}

Hamish

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