gmt clear <opt> and gmt-datadir issues
|Target version:||Candidate for next bugfix release|
There seem to be one or more issues with the new gmt clear <opt> functionality.
First, this appears to vary with which windows version you're using. I installed GMT 5.4.1 on both Windows 10 and Windows 8.1.
On Windows 10
The default datadir looks good. Created in my 'home' directory C:\Users\Andreas\.gmt as per default (I guess) containing a cache folder and relief data (when using auto download)
When I ask GMT where my datadir is, it says (null)
C:\Users\Andreas\Desktop\New folder>gmt --show-datadir (null)
Seems to work though.Giving
- gmt clear conf
- gmt clear history
- gmt clear cache
- gmt clear all
clears the cache, but does not delete gmt.conf and gmt.history. (I think this also applies to the Windows 8.1 case below, after I've added the HOME environment variable manually)
On Windows 8.1
Also says (null) when asked where the datadir is
C:\Users\Andreas\Desktop>gmt --show-datadir gmt: Unable to create GMT User directory : \/.gmt gmt: Auto-downloading of earth_relief_##m|s.grd files has been disabled. (null)
gmt clear all causes warning/error message and gmt.exe :
C:\Users\Andreas\Desktop>gmt clear all gmt: Unable to create GMT User directory : \/.gmt gmt: Auto-downloading of earth_relief_##m|s.grd files has been disabled.
The same warning is given if one tries
C:\Users\Andreas\Desktop>gmt clear history gmt: Unable to create GMT User directory : \/.gmt gmt: Auto-downloading of earth_relief_##m|s.grd files has been disabled.
but gmt.exe does not crash. I guess it's the gmt clear cache (which is included in the gmt clear all) that causes the crash (since this folder does not exist?).
If I manually add the environment variable HOME (as Joaquim hinted to in this forum post; http://gmt.soest.hawaii.edu/boards/1/topics/5288) and point to an existing folder, gmt.exe no longer crashes. Appears to run OK.
Using GMT 5.4.1 (r18203)
#1 Updated by Paul about 1 year ago
- Status changed from New to In Progress
- Target version set to Candidate for next bugfix release
I have added more checks in r18256 to detect cases like no HOME whatsoever. It should now warn and download to current directory. That can still fail if you do not have permission to write in the current directory. If you have time, please run your checks again and let me know if there is improvement or if there are still issues.