[GRASS5] filenames in GRASS database/r.mask

Markus Neteler neteler at geog.uni-hannover.de
Fri May 11 06:49:55 EDT 2001


On Fri, May 11, 2001 at 08:54:40AM +0000, Michel Wurtz wrote:
> "Eric G. Miller" wrote:
> 
> > Or, perhaps, we should disallow hyphens in GRASS database files?
> 
> Probably the best solution... in ascii, there is no difference
> between hyphen and minus.  Grass has a function for verifying
> the validity of database's file names G_legal_filename() which
> may be updated.  It looks actually :
> 
> 
> int G_legal_filename (char *s)
> {
>     if (*s == '.' || *s == 0) {
> 	fprintf(stderr, "Illegal filename.  Cannot be '.' or 'NULL'\n");
> 	return -1;
>     }
> 
>     for ( ; *s; s++)
> 	if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' || *s > 0176) {
> 		fprintf(stderr, "Illegal filename. character <%c> not allowed.", *s);
> 	    return -1;
> 	}
> 
>     return 1;
> }

An addition: I feel that "=" is even no allowed character. It can
be specified (on command line), later you run into troubles when
trying to use the map (on command line).

Just my experience,

 Markus

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list