[MINC-users] xfmconcat -clobber bug

Alex Zijdenbos zijdenbos at gmail.com
Wed Jul 4 12:19:53 EDT 2012


Hi all,

I just stumbled across a (actually two) problems with xfmconcat:

1) When run with -clobber, if the grid*.mnc files referenced in the
xfm are symlinks, it will try to clobber the files that are referenced
by the symlink, not the symlinks themselves, and

2) When it cannot overwrite the referent grid files (e.g., because of
write protection or ownership), it will throw a warning, but still
returns a 0 exit status.

So, when concat_grid_0.xfm is a symlink to a non-writeable file,
xfmconcat nominally succeeds:

$ ls -al concat_grid_0.mnc
0 lrwxrwxrwx 1 alex alex 13 2012-07-04 12:13 concat_grid_0.mnc -> /usr/bin/last*
$ xfmconcat -clobber a.xfm b.xfm concat.xfm
(from micreate): Unable to create file 'concat_grid_0.mnc'
Error: opening MINC file "concat_grid_0.mnc".
$ echo $?
0

Obviously, the resulting xfm (+grids) will not be what the user expected.

I think that at minimum, xfmconcat should fail when it can't write a
file; and I would also say that when clobbering, it should clobber a
symlink, not the referent file (but that latter point is up for debate
perhaps, which is actually why I raised it here).

-- A


More information about the MINC-users mailing list