Limit on filename length for AFNI programs?

Hi AFNI Gurus,

I’m encountering some issues with long filenames using AFNI programs. I have long filenames such as


If I try to load this with SUMA using the GUI, it says that it’s unable to read it:

Critical error SUMA_LoadNimlDset (suma_datasets.c:11654):
Failed to open NI stream for reading.
--     Error SUMA_LoadDsetOntoSO_eng (SUMA_Color.c:10264):
Failed to load dataset.
Make sure file exists
and is of a supported
format. See command line
for hints in other error
--     Error SUMA_LoadDsetOntoSO (SUMA_Color.c:10162):
Failed loading, and colorizing dset

However, if I load it from the command line (or symlink the file to e.g. test.niml.dset), it works perfectly:

suma -spec ~/Documents/experiments_work/famface_angles/derivatives/freesurfer/fsaverage6/SUMA/fsaverage6_rh.spec \
-input group_task-fam1back_space-hpalsid000005fsaverage6_hemi-R_cvrsa_metric-zcorrelation_sl_target-id+or+mi+ge_pred-identity_avg_thr.niml.dset

I had similar issues with 3dBucket and 3dinfo, where if the filename is too long, it says it’s unable to read it, but if it’s short enough, it’s fine. For example using the absolute path doesn’t work:

$ 3dinfo $PWD/group_task-fam1back_space-hpalsid000005fsaverage6_hemi-R_cvrsa_metric-zcorrelation_sl_target-id+or+mi+ge_pred-identity_avg_thr.niml.dset
++ 3dinfo: AFNI version=AFNI_18.0.11 (Jan 27 2018) [64-bit]
** FATAL ERROR: Can't open dataset /Users/contematto/Documents/experiments_work/famface_angles/derivatives103-budapest/slcvrsa-target-blockrun-deconvolve-hpalsid000005fsaverage6/group/group_task-fam1back_space-hpalsid000005fsaverage6_hemi-R_cvrsa_metric-zcorrelation_sl_target-id+or+mi+ge_pred-identity_avg_thr.niml.dset
** Program compile date = Jan 27 2018

but using the relative path works

$ 3dinfo group_task-fam1back_space-hpalsid000005fsaverage6_hemi-R_cvrsa_metric-zcorrelation_sl_target-id+or+mi+ge_pred-identity_avg_thr.niml.dset
++ 3dinfo: AFNI version=AFNI_18.0.11 (Jan 27 2018) [64-bit]

Dataset File:    group_task-fam1back_space-hpalsid000005fsaverage6_hemi-R_cvrsa_metric-zcorrelation_sl_target-id+or+mi+ge_pred-identity_avg_thr.niml.dset
Identifier Code: XYZ_Wmu_fGMPibIwwMVHBbNqAA  Creation Date: Thu May 31 10:10:54 2018
Template Space:
Dataset Type:    Anat Bucket (-abuc)

I’m using Mac OS X, but similar problems occur on Linux. Now I’m updating AFNI to see if perhaps it’s due to an old version.


I’m getting similar problems with the latest afni version

$ afni -version
Precompiled binary macosx_10.7_Intel_64: May 25 2018 (Version AFNI_18.1.18)

Finally looking at this, while most AFNI names are allowed to be 1024+
characters long, niml ones still seem to be limited to 256. We might be
able to bump that up, maybe. Until then, that is the limit for the niml.dset
file names, sorry.

  • rick