bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27240: inconsistent and confusing output from 'ln' vs. 'cp': can thi


From: Pádraig Brady
Subject: bug#27240: inconsistent and confusing output from 'ln' vs. 'cp': can this be fixed?
Date: Sun, 4 Jun 2017 21:12:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 04/06/17 14:12, L A Walsh wrote:
> 
> Needing to hardlink some files from tree1 to tree2, I
> had them in a script and @first used:
> "cp -lv":
> 
>>  cp -lv src/a dst/a    
> 'src/a' -> 'dst/a'
> 
> Later, I thought to use 'ln -v' for a different tree:
> 
>>  ln -v src/a dst/a
> 'dst/a' => 'src/a'
> 
> 
> Wait a sec.. I'm not linking from dst/a
> to src/b, but the other way around.

Well you're not linking in any direction for the hard link case.
You're creating 'dst/a'. Now you may argue that it should match
cp, though it probably makes more sense to match with the `ln -s` case.
For completeness we have:

$ touch a
$ ln -v a b
'b' => 'a'
$ ln -sv a c
'c' -> 'a'

$ cp -lv a d
'a' -> 'd'
$ cp -sv a e
'a' -> 'e'
$ cp -v a f
'a' -> 'f'

I read the above for ln as "dest linked to source"
and for cp as "source copied to dest".

> Hmm, it's using => instead of ->
> => is what is used for *symlinks*.. and there, one
> would create a link @ dst/a to point to (=>) src/a.

Well => is for hardlinks, and both -> and => were used
to distinguish the operations (in v5.92-191-g24ce72f)

Given the above interpretation I'm not sure there is
anything to change here.

thanks,
Pádraig





reply via email to

[Prev in Thread] Current Thread [Next in Thread]