Ignacio Fernández Galván <[EMAIL PROTECTED]> wrote:
> --- Jim Meyering <[EMAIL PROTECTED]> wrote:
>
>> Copying through a destination symlink is fundamentally risky,
>> so I've changed cp not to do it anymore.

Oops.  I have to clarify.

    Copying through a *dangling* destination symlink is fundamentally risky,
    so I've changed cp not to do it anymore.

> OK, thanks, I see.
>
>> Best is just not to do that anymore.  However, if it's something
>> you cannot easily avoid, you can do this instead:
>>
>>     $ cp -p link1 $(readlink -f link2)

Another way is simply to create the destination first:

    $ touch link2
    $ cp -p link1 link2

> Well, the problem is I don't do it, but it is sort of hardcoded in some
> other program I use, which was failing and I tracked the error down to
> this cp "feature". I will inform the maintainers of this other program.
> However, it might be a good idea to have some option to force this
> risky behaviour, maybe with --force ?

Adding an option is not impossible, but when you can get the same
effect portably by simply touching the dangling symlink,
it doesn't seem worthwhile.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to