[MINC-users] Of clobbering

Alex Zijdenbos alex at bic.mni.mcgill.ca
Mon Mar 18 09:06:35 EDT 2013


Hi Andrew,

Regardless of if this is a problem or not this behaviour comes about
> because of this:
>
>
> https://github.com/BIC-MNI/minc/blob/master/libsrc/hdf_convenience.c#L2299
>
> There are ways in HDF of checking if the target is a link.
>

Thanks! So I guess it's therefore pretty much all minc tools that behave
this way. And in fact this seems to be consistent with the default
behaviour of things like 'cp'. Curious. I would argue that a symlink is
analogous to a pointer (as opposed to a reference) in C, so that modifying
the pointer itself should not modify what it points to (unless explicitly
asked); but obviously that doesn't seem to be how it's seen in general.

I can also think of a few scripts that don't behave like the library
> and instead clobber the link and replace it with a file. The typically
> happens like this:
>
>    if( -e $outfile && $clobber){
>       system('rm -f $outfile);
>       }
>
>    system('stuff $infile $outfile');
>

Yes pretty much every script I've ever written does this, and I use it to
my advantage. For example, I use symlinks as space-saving copies for
running pipeline experiments - so I won't need to replicate terabytes of
data for testing the effect of a parameter change in the middle of a
pipeline; but in that setting I definitely don't want to modify my source
tree.

In any event, I go back to making sure I clobber everything explicitly
beforehand :)

-- A


More information about the MINC-users mailing list