CPT files without the .cpt extension

Added by Jim 11 months ago

Hi all,

I'm finding some unexpected behaviour with cpt names. If "foo.cpt" is a valid cpt file then

gmt pscontour ... -Cfoo.cpt ...

generates postscript OK, but if "foo" is a valid cpt file then

gmt pscontour ... -Cfoo ...

generates nothing (not even an error message) and returns 47. This arises since I'm generating a cpt whose depending on data and writing it to a temporary file with a random name.

This self-compiled 5.4.2 on Linux.

Cheers

Jim


Replies (2)

RE: CPT files without the .cpt extension - Added by Paul 11 months ago

There are places in GMT where we need to check from the filename that the file is a cpt and not some other type of table (e.g., for grdcontour). So generate random names but append .cpt.

RE: CPT files without the .cpt extension - Added by Jim 11 months ago

That fixes it, thanks (also, I should have read the docs, my bad).

A suggestion though: seeing as this seems to be a behaviour change since GMT4 (I was updating a v4 script which worked fine), and the passing of this cpt without a .cpt extension caused an error (47), would an error message be in order?

Cheers

Jim

(1-2/2)