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: Felipe Matas
Subject: bug#22022: ls - error making symbolic links with relative paths
Date: Fri, 27 Nov 2015 06:37:56 +0000 (UTC)

Hi, thx for the responce, for some reazon when i send the mail it takes that format D: (i check my mail and the format is correct).

Your translation of that was right!
Talking as a user is problem can't use this command 'ln -s b/a c/a' becasue i don't have how to know that condition or behavior, so its too easy fall in this.
¿are some way to ln -s always transform the rutes to full path except wih --relative? (only an idea)

Thx.

El Viernes, 27 de noviembre, 2015 1:13:24, Eric Blake <address@hidden> escribió:


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




reply via email to

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