[GRASS-dev] [GRASS GIS] #2025: r.kappa: output file saving error on Windows

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
winGRASS users report that they are unable to save the error
matrix and kappa to a file.

Feb 28, 2013 Rebecca wrote:[[BR]]
I have tried both with the GUI and in python script.[[BR]]

I am running it using NX client and so my file paths have '\' symbols to
represent directories. When I use the 'browse' icon to locate the correct
directory/file, grass automatically uses '\'. However I am receiving the
error msg:

Illegal filename. Character </> not allowed.

For a similar report, see also:

http://fromgistors.blogspot.it/2013/07/classification-error-QGIS.html (at
page bottom)

Random ideas:

There must be something lacking in the ask() function:
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/lib/gis/ask.c#L345

Perhaps a Windows specific directory separator is needed,
similar to

http://trac.osgeo.org/grass/changeset/55135/grass/branches/releasebranch_6_4/lib/g3d

?

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

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by glynn):

Replying to [ticket:2025 neteler]:

> Illegal filename. Character </> not allowed.

This was fixed in 7.0 with r32820. I suggest back-porting.

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

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mmetz):

Replying to [comment:1 glynn]:
> Replying to [ticket:2025 neteler]:
>
> > Illegal filename. Character </> not allowed.
>
> This was fixed in 7.0 with r32820. I suggest back-porting.
>
Done in r57045,6.

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

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

Replying to [comment:2 mmetz]:
> Replying to [comment:1 glynn]:
> > Replying to [ticket:2025 neteler]:
> >
> > > Illegal filename. Character </> not allowed.
> >
> > This was fixed in 7.0 with r32820. I suggest back-porting.
> >
> Done in r57045,6.

I have made a patch of r32820, diff against relbranch64 attached (recent
r.kappa
fixes already excluded from r32820 backport).

Please verify the attached diff. It compiles on my (Linux) machine.

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

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

Replying to [comment:3 neteler]:
> I have made a patch of r32820, diff against relbranch64 attached (recent
r.kappa
> fixes already excluded from r32820 backport).

It additionally requires:

svn rm raster/r.surf.fractal/interface.c

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

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mmetz):

Replying to [comment:3 neteler]:
> Replying to [comment:2 mmetz]:
> > Replying to [comment:1 glynn]:
> > > Replying to [ticket:2025 neteler]:
> > >
> > > > Illegal filename. Character </> not allowed.
> > >
> > > This was fixed in 7.0 with r32820. I suggest back-porting.
> > >
> > Done in r57045,6.
>
> I have made a patch of r32820, diff against relbranch64 attached (recent
r.kappa
> fixes already excluded from r32820 backport).

G_legal_filename() is meant for GRASS data file names (anything in
$GISDASE/$LOCATION_NAME/$MAPSET/<element>/, therefore your patch does not
make sense.

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

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

Replying to [comment:5 mmetz]:
> G_legal_filename() is meant for GRASS data file names (anything
> in $GISDASE/$LOCATION_NAME/$MAPSET/<element>/, therefore your
> patch does not make sense.

So you mean that the original r32820 doesn't make sense? I just
prepared a backport patch...

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

#2025: r.kappa: output file saving error on Windows
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.kappa | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mmetz):

Replying to [comment:6 neteler]:
> Replying to [comment:5 mmetz]:
> > G_legal_filename() is meant for GRASS data file names (anything
> > in $GISDASE/$LOCATION_NAME/$MAPSET/<element>/, therefore your
> > patch does not make sense.
>
> So you mean that the original r32820 doesn't make sense? I just
> prepared a backport patch...

The original r32820 makes sense because in this case the output is a file
anywhere on the file system.

G_legal_filename() is meant for GRASS data file names (anything in
GISDASE/$LOCATION_NAME/$MAPSET/<element>/, not for output files located in
a user-defined folder.

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

#2025: r.kappa: output file saving error on Windows
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Resolution: fixed | Keywords: r.kappa
  Platform: MSWindows 7 | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by neteler):

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

Comment:

OK no problem, proposed backport of r32820 deleted.

The original ticket is solved anyway, closing.

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

#2025: r.kappa: output file saving error on Windows
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Resolution: fixed | Keywords: r.kappa
  Platform: MSWindows 7 | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by glynn):

Replying to [comment:7 mmetz]:

> G_legal_filename() is meant for GRASS data file names (anything in
GISDASE/$LOCATION_NAME/$MAPSET/<element>/, not for output files located in
a user-defined folder.

It's meant for anything which will be a single component of a pathname:
either an unqualified map name, or a mapset name, or a location name.

Any characters which have "meaning" to GRASS or to the OS are not "legal"
in this sense, so it rejects names which contain e.g. "@" (mapset
separator) or "/" (directory separator).

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

#2025: r.kappa: output file saving error on Windows
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Resolution: fixed | Keywords: r.kappa
  Platform: MSWindows 7 | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by neteler):

G_legal_filename() cleanup patch (backport from G7) for GRASS 6 moved to
ticket #2031

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