[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'cp -lL' behaviour conflicts with documentation
From: |
Jim Meyering |
Subject: |
Re: 'cp -lL' behaviour conflicts with documentation |
Date: |
Tue, 15 Mar 2005 21:01:23 +0100 |
Hi Bob,
address@hidden (Bob Proulx) wrote:
> Jim Meyering wrote:
>> Is it worth it to make cp manually follow a sequence of symlinks
>> when given both -L and --link?
>
> That would certainly be a nice capability.
>
> If it is not worth it could that case be made an invalid case? That
> way there is no doubt. Because I agree that I would not have expected
> a hard link to a symlink when using -L,--dereference.
In case anyone is interested in implementing this,
be careful to detect symlink cycles (use cycle-check.[ch]).
You'll have to specify what happens when there is no referent,
either because of a dangling symlink or because of a cycle.
If that happens for a command line argument,
then it should provoke a non-zero exit.
If it happens for a non-command-line-argument (e.g., during
a recursive traversal), then what? In any case, it deserves
a diagnostic. Whether it should exit nonzero... I could
go either way. I'm leaning towards making it fail.