[GRASS-dev] mapsets and locations with spaces on wingrass?

Hi developers,
I browsed the native grass package Known Issues, but couldn't find an answer.

Does grass on windows have problems with spaces in the mapset or location path?

I tried to launch the console mode and it seems to accept the "test
location" and "test mapset" entries.
When I then do ESC-ENTER, it proposes me to create the mapset "test",
which means it doesn't take the full path.

Thanks,
Andrea

Ok, found the following:
"If installed into a directory that has spaces in either its name or
the path of directories leading up to it, some functionalities of
GRASS might be hampered. We would highly appreciate if you tried and
reported any problems, so that we can fix them. "

I suppose that this means that usually at least it can be started, right?
Is there a list of the hampered functionalities?

Launching commands from the JGrass prepared environment I get an error
telling that the filename is illegal because of the < > character,
which I assume being the space. So the maps are not found and the
command is not launched.

Any idea on this?
Andrea

On Wed, Oct 15, 2008 at 1:22 PM, andrea antonello
<andrea.antonello@gmail.com> wrote:

Hi developers,
I browsed the native grass package Known Issues, but couldn't find an answer.

Does grass on windows have problems with spaces in the mapset or location path?

I tried to launch the console mode and it seems to accept the "test
location" and "test mapset" entries.
When I then do ESC-ENTER, it proposes me to create the mapset "test",
which means it doesn't take the full path.

Thanks,
Andrea

On Wed, Oct 15, 2008 at 2:03 PM, andrea antonello
<andrea.antonello@gmail.com> wrote:
(previous mail)

The code in question for the CLI startup is in
lib/init/set_data.c

Perhaps some quoting is missing there (I also see short name buffers there
and such).

Ok, found the following:
"If installed into a directory that has spaces in either its name or
the path of directories leading up to it, some functionalities of
GRASS might be hampered. We would highly appreciate if you tried and
reported any problems, so that we can fix them. "

I suppose that this means that usually at least it can be started, right?

I think you can with command line startup.

I tried

Is there a list of the hampered functionalities?

I am afraid no. But myself, I used it for weeks with a white space in the
path name, it worked (say, we fixed a couple of things in those days).
So, in the path to the GRASS database including that is might be ok,
but apparently not yet in a location name.

Markus

Launching commands from the JGrass prepared environment I get an error
telling that the filename is illegal because of the < > character,
which I assume being the space. So the maps are not found and the
command is not launched.

Any idea on this?
Andrea

On Wed, Oct 15, 2008 at 1:22 PM, andrea antonello
<andrea.antonello@gmail.com> wrote:

Hi developers,
I browsed the native grass package Known Issues, but couldn't find an answer.

Does grass on windows have problems with spaces in the mapset or location path?

I tried to launch the console mode and it seems to accept the "test
location" and "test mapset" entries.
When I then do ESC-ENTER, it proposes me to create the mapset "test",
which means it doesn't take the full path.

Thanks,
Andrea

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi Markus,
thanks for the reply.

[...]

I am afraid no. But myself, I used it for weeks with a white space in the
path name, it worked (say, we fixed a couple of things in those days).
So, in the path to the GRASS database including that is might be ok,
but apparently not yet in a location name.

Pretty sure that is the point. Having a space both in the mapset and
in the location leads to failure for me.
GRASS doesn't even open (both console and gui mode) in that case.

Ciao
Andrea

Markus

Launching commands from the JGrass prepared environment I get an error
telling that the filename is illegal because of the < > character,
which I assume being the space. So the maps are not found and the
command is not launched.

Any idea on this?
Andrea

On Wed, Oct 15, 2008 at 1:22 PM, andrea antonello
<andrea.antonello@gmail.com> wrote:

Hi developers,
I browsed the native grass package Known Issues, but couldn't find an answer.

Does grass on windows have problems with spaces in the mapset or location path?

I tried to launch the console mode and it seems to accept the "test
location" and "test mapset" entries.
When I then do ESC-ENTER, it proposes me to create the mapset "test",
which means it doesn't take the full path.

Thanks,
Andrea

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi all

So, in the path to the GRASS database including that is might be ok,
but apparently not yet in a location name.

Pretty sure that is the point. Having a space both in the mapset and
in the location leads to failure for me.
GRASS doesn't even open (both console and gui mode) in that case.

The main problems rely on spaces in the GRASS path; I still did not detected problems related to spaces in the GIS Data Base path when launching executable modules; I suppose there may be some problems only when launching scripts.

Regards,

Marco

Hi Marco,

So, in the path to the GRASS database including that is might be ok,
but apparently not yet in a location name.

Pretty sure that is the point. Having a space both in the mapset and
in the location leads to failure for me.
GRASS doesn't even open (both console and gui mode) in that case.

The main problems rely on spaces in the GRASS path; I still did not detected
problems related to spaces in the GIS Data Base path when launching
executable modules; I suppose there may be some problems only when launching
scripts.

Sorry, I'm not sure I get you.
I am sure that there are problems if the location name has spaces or
the mapset name has spaces.
You agree with that?

Ciao,
Andrea

Regards,

Marco

Hi Andrea

Sorry, I'm not sure I get you.
I am sure that there are problems if the location name has spaces or
the mapset name has spaces.
You agree with that?

Absolutely YES!

But the GISDBASE path (not the location or mapset, but the leading folder only) allow spaces.

Marco

andrea antonello wrote:

> I browsed the native grass package Known Issues, but couldn't find an answer.
>
> Does grass on windows have problems with spaces in the mapset or location path?
>
> I tried to launch the console mode and it seems to accept the "test
> location" and "test mapset" entries.
> When I then do ESC-ENTER, it proposes me to create the mapset "test",
> which means it doesn't take the full path.

You might have more luck with the GUI startup.

"If installed into a directory that has spaces in either its name or
the path of directories leading up to it, some functionalities of
GRASS might be hampered. We would highly appreciate if you tried and
reported any problems, so that we can fix them. "

I suppose that this means that usually at least it can be started, right?
Is there a list of the hampered functionalities?

No. Most of these issues are trivial to fix once we become aware of
them, so the number of known problems in the current development
version is usually zero. AFAIK, there is no specific list of such
problems which have been fixed since the last release.

Launching commands from the JGrass prepared environment I get an error
telling that the filename is illegal because of the < > character,
which I assume being the space. So the maps are not found and the
command is not launched.

Any idea on this?

Any problems with JGrass should be directed to the JGrass developers.

More generally, when reporting bugs, you need to state which version
you were using. You also need to provide enough information for others
to have a reasonable prospect of reproducing the problem (i.e. the
exact commands used and any error messages).

--
Glynn Clements <glynn@gclements.plus.com>

[...]

Launching commands from the JGrass prepared environment I get an error
telling that the filename is illegal because of the < > character,
which I assume being the space. So the maps are not found and the
command is not launched.

Any idea on this?

Any problems with JGrass should be directed to the JGrass developers.

Perhaps I didn't explain myself well. Not asking for solvin JGrass
problems for that.
The error is a GRASS error. The fact that it was launched from JGrass
is pure info added.

More generally, when reporting bugs, you need to state which version
you were using. You also need to provide enough information for others
to have a reasonable prospect of reproducing the problem (i.e. the
exact commands used and any error messages).

Which is what I did (apart of telling the version, which is the last
found on the grass page) I think. The problem is at startup, all I
knew was what I wrote. No command executed and no error I get, so just
a description made of guesses. Anyway I was asking to understand if it
is a problem of my installation or really a general problem. Still to
early for me to file a bug.

Andrea

--
Glynn Clements <glynn@gclements.plus.com>

Sorry, I'm not sure I get you.
I am sure that there are problems if the location name has spaces or
the mapset name has spaces.
You agree with that?

Absolutely YES!

But the GISDBASE path (not the location or mapset, but the leading folder
only) allow spaces.

Yes, I confirm that.

Andrea

Marco

On Wed, Oct 15, 2008 at 3:23 PM, Markus Neteler <neteler@osgeo.org> wrote:

The code in question for the CLI startup is in
lib/init/set_data.c

Perhaps some quoting is missing there (I also see short name buffers there
and such).

I would do it since it is usually trivial. Just I don't remember the "quoting"
trick which is needed there. My memory faded...

Markus

andrea antonello wrote:

>>> So, in the path to the GRASS database including that is might be ok,
>>> but apparently not yet in a location name.
>>
>> Pretty sure that is the point. Having a space both in the mapset and
>> in the location leads to failure for me.
>> GRASS doesn't even open (both console and gui mode) in that case.
>>
>
> The main problems rely on spaces in the GRASS path; I still did not detected
> problems related to spaces in the GIS Data Base path when launching
> executable modules; I suppose there may be some problems only when launching
> scripts.

Sorry, I'm not sure I get you.
I am sure that there are problems if the location name has spaces or
the mapset name has spaces.
You agree with that?

Aha. I had assumed that you were talking about spaces in the database
path (GISDBASE), which should work but occasionally doesn't.

While the database path can (in theory) be any legal pathname, spaces
(and various other characters) are not permitted "beyond that point":
not in the names of locations, mapsets, or maps (or similar entities,
e.g. imagery groups, named regions, etc).

That isn't specific to Windows.

For most of GRASS, names cannot contain any of the following
characters:

  / " ' @ , = *

(slash, double quote, single quote, at, comma, equals, asterisk), nor
can they contain spaces, control characters (codes below 32), the
delete character (code 127) or 8-bit characters (codes 128 and above).

The following:

  \ : ? < > |

(backslash, colon, question mark, less-than, greater-than, vertical
bar) aren't specifically prohibited by GRASS, but won't work on
Windows as they aren't allowed in filenames.

For vector maps, the rules are even more restrictive: a vector map
name must be a valid SQL identifier, which means that it must begin
with a letter, can only contain letters, digits and underscores,
cannot be an SQL keyword, and cannot exceed any maximum length imposed
by the database backend which is used.

--
Glynn Clements <glynn@gclements.plus.com>

Hi Glynn,
thanks for your indeep clarification. It is indeed interesting.

So if I got it right, the fact that locations and mapsets with spaces
work in GRASS on linux and unix is more a present of the operating
system, than anything else? The fact that paths in windows are a bit
stranger (%20 for spaces in urls, the leading \ and such...) makes
this all messy?

Regards,
Andrea

>>> So, in the path to the GRASS database including that is might be ok,
>>> but apparently not yet in a location name.
>>
>> Pretty sure that is the point. Having a space both in the mapset and
>> in the location leads to failure for me.
>> GRASS doesn't even open (both console and gui mode) in that case.
>>
>
> The main problems rely on spaces in the GRASS path; I still did not detected
> problems related to spaces in the GIS Data Base path when launching
> executable modules; I suppose there may be some problems only when launching
> scripts.

Sorry, I'm not sure I get you.
I am sure that there are problems if the location name has spaces or
the mapset name has spaces.
You agree with that?

Aha. I had assumed that you were talking about spaces in the database
path (GISDBASE), which should work but occasionally doesn't.

While the database path can (in theory) be any legal pathname, spaces
(and various other characters) are not permitted "beyond that point":
not in the names of locations, mapsets, or maps (or similar entities,
e.g. imagery groups, named regions, etc).

That isn't specific to Windows.

For most of GRASS, names cannot contain any of the following
characters:

       / " ' @ , = *

(slash, double quote, single quote, at, comma, equals, asterisk), nor
can they contain spaces, control characters (codes below 32), the
delete character (code 127) or 8-bit characters (codes 128 and above).

The following:

       \ : ? < > |

(backslash, colon, question mark, less-than, greater-than, vertical
bar) aren't specifically prohibited by GRASS, but won't work on
Windows as they aren't allowed in filenames.

For vector maps, the rules are even more restrictive: a vector map
name must be a valid SQL identifier, which means that it must begin
with a letter, can only contain letters, digits and underscores,
cannot be an SQL keyword, and cannot exceed any maximum length imposed
by the database backend which is used.

--
Glynn Clements <glynn@gclements.plus.com>

Does grass on windows have problems with spaces in the
mapset or location path?

The GIS database directory path (C:\$HOME\grassdata\) may contain spaces.

mapset and location names may not. (nor may map names)
(problematic for map@othermapset, r.proj/g.list mapset= options, etc.)

Hamish

andrea antonello wrote:

So if I got it right, the fact that locations and mapsets with spaces
work in GRASS on linux and unix is more a present of the operating
system, than anything else? The fact that paths in windows are a bit
stranger (%20 for spaces in urls, the leading \ and such...) makes
this all messy?

No. Spaces are specifically prohibited in location names, mapset
names, map names or other "names", on all platforms.

Spaces *are* permitted in paths, including the database path
(GISDBASE).

However, using spaces in file and directory names has historically
been uncommon on Unix (they are problematic for command-line use, as
you have to use quoting), and the ability to run GRASS natively on
Windows is a relatively recent situation.

Consequently, bugs which only affect paths containing spaces have
started to be discovered as more people use GRASS on Windows, where
spaces in paths are common.

The characters which are specifically prohibited (by GRASS) from being
used in "names" are prohibited because they are used by GRASS itself.
E.g. "@" is used to separate the map name from the mapset name in a
qualified map name, "=" is used to separate option values from option
names, "," is used to separate values in a list, etc.

Unix allows any character (byte) to appear in a filename except for
"/" (the directory separator) and the NUL byte (the C string
terminator). You can even have newlines in filenames (although that
will cause all sorts of problems with various programs).

But Windows prohibits several additional characters in filenames.
GRASS itself doesn't try to prevent you from using those characters in
names, but as GRASS uses those names as file and directory names, they
won't work on Windows.

--
Glynn Clements <glynn@gclements.plus.com>