Bug #1098

gmt clear <opt> and gmt-datadir issues

Added by Andreas about 1 month ago. Updated 9 days ago.

Status:ClosedStart date:2017-05-15
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:

Description

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

work fine.

Giving
  • 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 crashes:

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)

Associated revisions

Revision 18256
Added by Paul about 1 month ago

Address issue #1098

History

#1 Updated by Paul about 1 month 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.

#2 Updated by Paul 9 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

I believe this has been addressed. Please reopen if not.

Also available in: Atom PDF