[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v2] ln: add the --relative option
From: |
Voelker, Bernhard |
Subject: |
RE: [PATCH v2] ln: add the --relative option |
Date: |
Fri, 24 Feb 2012 08:58:56 +0100 |
address@hidden wrote:
> With the "--relative --symbolic" options, ln computes the relative
> symbolic link for the user.
I also like this idea.
> $ ln -s -v --relative usr/bin/foo usr/lib/foo/link-to-foo
> 'usr/lib/foo/link-to-foo' -> 'foo'
>
> $ tree ./
> ./
> `-- usr
> |-- bin
> | `-- foo -> ../lib/foo/foo
> `-- lib
> `-- foo
> |-- link-to-foo -> foo
> `-- foo
>
> 4 directories, 3 files
In this case, I am be a bit surprised that ln has created
a symlink to the resolved target ('foo') instead of to what
the user told us to do: '../../../bin/foo'.
I'd have expected this only with an additional "resolve" or
"canonicalize" option.
> + if (relative && !symbolic_link)
> + {
> + error (EXIT_FAILURE, 0,
> + _("cannot do --relative without --symbolic"));
> + }
Why restrict this to symlinks - it could also be useful for
hardlinks, right?
Have a nice day,
Berny