bug-coreutils
[Top][All Lists]
Advanced

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

bug#22022: ls - error making symbolic links with relative paths


From: Eric Blake
Subject: bug#22022: ls - error making symbolic links with relative paths
Date: Thu, 26 Nov 2015 21:13:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/26/2015 10:32 AM, Felipe Matas wrote:

Did you mean 'ln' rather than 'ls' in the subject line?

> Hi, well this happend when we try to make a symbolic link with a relative 
> when the dist directory is a subdirectory.if you repeat this examples with a 
> full path it works.
> Ex, in bash
> mkdir bmkdir cecho "hi" > b/aln -s b/* c/## here when we do 'cat c/a' we get: 
> No such file or directory - The link existrm c/aln -s b/a c/## here when we 
> do 'cat c/a' we get: No such file or directory - The link exist

Your (lack of) formatting made your report practically impossible to
read.  Would you mind resending your post in a legible format?

However, if I deciphered correctly, you did:

mkdir b c
echo hi > b/a
ln -s b/* c/

Try doing it again with -v to see what actually was done:

$ ln -sv b/* c/
‘c/a’ -> ‘b/a’

That is, the contents of the link at 'c/a' is literally the string 'b/a'
- even though that string does not resolve to any location available
from  'c'.  However, this is not a bug; it is the behavior that POSIX
requires for 'ln -s'.

You may be interested in trying 'ln --relative -sv b/* c/' instead,
which creates 'c/a' as a symlink to '../b/a', and therefore resolves
rather than creating a dangling symlink.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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