[MINC-users] space in file names

Pierre Bellec pbellec at bic.mni.mcgill.ca
Thu Aug 2 12:25:06 EDT 2012


Dear Minc users,

I think I ran into a bug related to space in file names. If I run

$ mincheader /home/pbellec/Ubuntu\
One/articles/Marrelec_BMI/real_data/atoms.mnc

I get the following error:

/opt/minc/bin/mincheader: 107: [: /home/pbellec/Ubuntu: unexpected operator
mincheader: no such file /home/pbellec/Ubuntu
One/articles/Marrelec_BMI/real_data/atoms.mnc

Using an alternative method is not more successful:

$ mincheader "/home/pbellec/Ubuntu
One/articles/Marrelec_BMI/real_data/atoms.mnc"
/opt/minc/bin/mincheader: 107: [: /home/pbellec/Ubuntu: unexpected operator
mincheader: no such file /home/pbellec/Ubuntu
One/articles/Marrelec_BMI/real_data/atoms.mnc

Both methods will work with other commands such as "ls". You may just
think, who puts a space in a folder name anyway ? Well, the guys from
Ubuntu One do. Please let me know if you have an alternative method.

For info, the minc tools have been installed using the minc-toolkit package
of Vladimir. There is no "-version" option in mincheader, but the script
has the following info:
# Modifications:
#   $Log: mincheader,v $
#   Revision 6.4  2008-01-04 06:01:23  rotor
#    * updated shell scripting style and added more verbose help
#
# (...)

and mincdump -version gives
program: 2.1.20
libminc: 2.1.20
netcdf : 4.2 of Apr 19 2012 15:06:12 $
HDF5   : 1.8.8

As a sidenote, this means that the NIAK reader/writer breaks on files which
are located in a folder with spaces in the name. Interestingly the command
will work if the file is zipped (for minc1 files), beause for various
reasons NIAK will first copy the file in the tmp folder before unzipping it
(that part works regardless of spaces and the tmp folder does not have
space in the name). I suspect NIAK will break if the file name itself has
spaces in it, regardless of the zip status.

Best,

Pierre Bellec, PhD
Chercheur adjoint
Centre de recherche de l'institut de Gériatrie de Montréal
Département d'informatique et de recherche opérationnelle
Université de Montréal
http://simexp-lab.org/brainwiki/doku.php?id=pierrebellec
(001)(514) 340 3540 #3367


More information about the MINC-users mailing list