[GRASS-dev] GEM Wizard question
michael.barton at asu.edu
Wed May 23 02:43:07 EDT 2007
When I've tried to use home without checking for its existence first, I've
had reports of errors back from some users who claim that they do not have
HOME set to anything. So I always try to check to see if it is valid.
On 5/22/07 11:00 PM, "Hamish" <hamish_nospam at yahoo.com> wrote:
> William Kyngesburye wrote:
>> 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.
> Python/SWIG scripting:
>>>> print homedir
> "~" is expanded by the shell AFAIK, so that requires a shell to expand.
> "$HOME" works for me, where doesn't it work Michael?*
> On ms windows there is %HOMEPATH% and %USERPROFILE%.
> No idea how they differ,
> MS Windows Command shell overview:
> [*] GRASS must know where home is, as that's where it looks for .grassrc6.
> lib/init/init.bat does:
> if "%HOME%"=="" set HOME=%USERPROFILE%
> set WINGISRC=%HOME%\.grassrc6
> lib/init/init.sh does:
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
More information about the grass-dev