[GRASS5] filenames in GRASS database/r.mask

Michel Wurtz mw at teledetection.fr
Fri May 11 04:54:40 EDT 2001


"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;
}
--
Michel WURTZ - DIG - Maison de la télédétection
               500, rue J.F. Breton
               34093 MONTPELLIER Cedex 5

---------------------------------------- 
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