x2sys_put

Added by Roi 10 months ago

Hi All,

I am trying to initialize a new dataset the following way:
gmt x2sys_init aero -Dgeoz -V -I1 -Cg -Exym -Gg -Ndk -F -Rg #seems to work fine - it adds the files (xxx_path.txt, xxx_index.b, xxx_tracks.d, .def and .tag) to the right folder
gmt x2sys_binlist test.xym -Taero > test.tbf #works fine, content is fine
Whe I run this:
gmt x2sys_put test.tbf -Taero
I get this message:
x2sys_put: Failed to remove /usr/local/gmt458/share/x2sys/aero/aero_tracks.d_old! [remove error: No such file or directory] #note: it has never produced this _old file
when I try:
sudo gmt x2sys_put test.tbf -Taero
I get this message:
x2sys_put: Error: $X2SYS_HOME has not been set but is a required parameter
although I have it in my .bashrc file and when I do
echo $X2SYS_HOME
I get the correct answer

I've tried running this with 5.4.1 and 5.4.3 (Mac) but got the same results.

Any help would be much appreciated,

Roi


Replies (3)

RE: x2sys_put - Added by Paul 10 months ago

Hi Roi-

The failed to remove messages are harmless, but I have now added a check to make sure they exist before we try to delete them. However, the X2SYS_HOME is more puzzling since the code that prints the messages is this:

    if ((this = getenv ("X2SYS_HOME")) != NULL) {    /* Set user's default path */
        X2SYS_HOME = gmt_M_memory (GMT, NULL, strlen (this) + 1, char);
        strcpy (X2SYS_HOME, this);
    }
    else {    /* Require user to set this parameters since subdirs will be created and it would be messy to just use . */
        GMT_Report (GMT->parent, GMT_MSG_NORMAL, "Error: %s has not been set but is a required parameter\n", par);
        GMT_exit (GMT, GMT_RUNTIME_ERROR);
    }

Thus. that message can only be printed if getenv fails to find an X2SYS_HOME in the environment. The reason it complaints is that you are running that command as superuser (sudo) and that user does not have X2SYS_HOME set...

RE: x2sys_put - Added by Roi 10 months ago

Thanks Paul,

Even without the sudo, it doesn't work:
gmt x2sys_put test.tbf -Taero
x2sys_put: Failed to remove /usr/local/gmt458/share/x2sys/aero/aero_tracks.d_old! [remove error: No such file or directory]

And none of the files located within the folder are being changed at all:
aero_paths.txt
aero_index.b
aero_tracks.d
geoz.def
aero.tag

Any suggestion that will help to overcome this issue would be much appreciated,

Thanks

Roi

RE: x2sys_put - Added by Paul 10 months ago

So your X2SYS_HOME points to /usr/local/gmt458 and you have write permission there? Sounds like a GMT 4 path. Try to add -Vd to see if anything useful is printed. Otherwise, I can only help if you can distill the problem down with a small file or a set of files that you can share so we can reproduce the problem.

(1-3/3)