Full path problem

Hello,
I have a problem using the full path of my files…

If I use a short path like this, it works:

gmt begin
gmt x2sys_init MJC -Ddefinition -Edat -F -Gd -I0.50/0.50 -Rd -je
gmt x2sys_cross "E:\DTU21\*_res.dat" -TMJC -Ia -Qe > CROSSOVERS.txt
gmt end

But for a path like this, it does not work:

gmt begin
gmt x2sys_init MJC -Ddefinition -Edat -F -Gd -I0.50/0.50 -Rd -je
gmt x2sys_cross "E:\a\bbb\DTU21\*_res.dat" -TMJC -Ia -Qe > CROSSOVERS.txt
gmt end

They are both full paths. What happens in the “not work” case? Anyway, and being honest, if it works on first case, use it because we are short in labor power to hunt for these type of failures.

1 Like

I know the two are full paths.
The problem is my files were in the long path and it caused problem.
So, I tried to put my files in a shorter path and it run correctly.
If there is no way to solve it I will use the sorter path, Thank you for response.

Hmm, if that’s a path length issue, it should be easier to fix. Can you find what is the path length limit that works?

260 characters.
But I use paths longer than the mentioned one in other modules and it works, so I think the problem is with the x2sys modules.

Are you able to build GMT to try one thing? Otherwise, I will need a reproducible example.

I’ve also run into path length issues when I end up using long sensitivity test identifiers, but I think this is usually when the figure is converted to PDF/PNG (gmt end… so psconvert/gs?). I also occasionally hit length limits for comments in grid file headers (grdmath) due to these long filenames. I resorted to saving figures as a temporary file and renaming it after making it as an ugly workaround to my ugly filenames (thankfully, they are usually not quite ugly enough to cause this problem). I think this is effectively the same as your workaround (shortening the path)

1 Like

Comment length limits in grid headers are a documented feature and have no workaround, nor cause any troubles (other than chopping the comment). psconvert file names allocate a 1024 char buffer, so hard to exhaust it. But if those problems arise, please report them with a reproducible example.

For example, this script is run correctly:

for %%i in ("D:\02-Doctorate\03-practical\07-CROSSOVER_FINAL_REVISION_06-JUNE-2025\03-EVALUAION\ALTIMETRY\DTU17\*_res.dat") do (

gmt select "%%i" -Z-20/20+c5 > %%~ni.dat

)

But when using the x2sys package, the problem occurs as I mentioned before.

Thanks … but unfortunately that helps nothing. I need that either 1) you are able to compile GMT and try one thing or 2) you provide a reproducible example.