[GRASS-dev] Windows-style Pathnames

Glynn Clements glynn at gclements.plus.com
Thu Nov 2 21:16:17 EST 2006

Hamish wrote:

> > However, using / should work as an argument to fopen(). The issue is
> > more significant if paths are constructed and stored for later use
> > (e.g. in $GISRC). In that situation, we need to decide whether to:
> > 
> > 1. create and store the pathname in the host's syntax, or
> > 2. store it in Unix syntax and convert it as required.
> > 
> > Either option will involve a lot of changes. #1 is easier to
> > implement, but will probably need to be done in more places (it needs
> > to be done for every pathname which might need to be in host syntax at
> > some point). #2 is harder, but only needs to be performed in places
> > where host syntax is known to be necessary.
> option #1 means that moving a GISDBASE from window->unix will result in
> breakage?
> If it were limited to .grassrc6 it wouldn't be too much of a problem,
> but what about path names stored in the data? 
> G63> cd $MAPSET
> G63> cat VAR 
> GV_DRIVER: dbf
> DB_DRIVER: dbf
> G63> cat vector/$VECT_MAP/dbln 
> 1 Depth cat $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf

Pathnames stored in data aren't generally portable between any two
systems, even if they're running the same OS. There's no reason to
believe that any given path will exist on the destination system.

The specific case of the above would have been better dealt with by
treating relative pathnames as being relative to the mapset directory,
so you would just store "dbf" in the above case.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list