[GRASS-dev] GEM Wizard question

Michael Barton michael.barton at asu.edu
Tue May 22 12:18:09 EDT 2007

On 5/22/07 8:46 AM, "William Kyngesburye" <woklist at kyngchaos.com> wrote:

> On May 22, 2007, at 10:13 AM, Benjamin Ducke wrote:
>> Now, the only remaining question is where to store all extension files
>> (by default). We need a directory that work cross-platform (or at
>> least
>> a unified way to figure out a user home directory on all supported
>> platforms; possible as a new function in the C API).
> I'd prefer something that is appropriate for the platform.  ie the /
> Library/GRASS and ~/Library/GRASS I'm using for the OSX app build.
> The simple way to solve the choice is to use env vars, like the rest
> of GRASS.  That way the mechanism is there and the user or packager
> can decide what is appropriate, and the user can add to it at runtime
> if needed. (I set some user dirs in the OSX app startup script,
> before init.sh is run, to handle this)


This seems like the easiest way to deal with platform-specific variations in
where things 'ought to go'.

> Note - there is a libgis function to get a user's home: G_home().  It
> should work on all platforms (it has a mingw special case, but maybe
> it doesn't work on the Win native build?).  It would be handy to have
> a command equivalent to use in scripts, like g.home.

I've found that home is not necessarily set on all systems. Usually, but not
always. So if you use this,  you need to be able to check to see if this is
not returning anything and then default to the root or current working
directory (or something else sane)


> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
> First Pogril: Why is life like sticking your head in a bucket filled
> with hyena offal?
> Second Pogril: I don't know.  Why IS life like sticking your head in
> a bucket filled with hyena offal?
> First Pogril: I don't know either.  Wretched, isn't it?
> -HitchHiker's Guide to the Galaxy

Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton 

More information about the grass-dev mailing list