bug-coreutils
[Top][All Lists]
Advanced

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

bug#27538: ln -s creating broken sym link?


From: Jonny Grant
Subject: bug#27538: ln -s creating broken sym link?
Date: Sat, 1 Jul 2017 09:44:57 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1



On 01/07/17 00:54, Bernhard Voelker wrote:
tag 27538 notabug
close 27538
stop

On 06/30/2017 02:58 PM, Jonny Grant wrote:
Hello

Managed to create a broken link, but didn't get any warning.

Why would you expect to get a warning?  Symlink links are just like
that - they are soft, loose or whatever you may call them.  The target
does not have to exist.  Some people or software even use them to
store little pieces of data in the target name of symbolic links;
IIRC e.g. the old netscape did that to store the PID of the process
like 'pid' -> 'localhost:12345'.

Example below - am I miss-understanding something?

$ mkdir mydir

$ ln -s sym mydir

yes, you told ln(1) to create a symlink to 'sym', and as 'mydir'
was an existing directory, the basename of the symlink is also
'sym', and the link is created in the directory.

Please consider using additional options like -n, -v, -f or others
to get results closer to your expectations.

$ cd mydir

$ ls -l

total 0

lrwxrwxrwx 1 jonny jonny 3 Jun 27 11:02 sym -> sym

Therefore, ln(1) works as expected, and there's not much we can do
about it.  Thus, I'm hereby marking this as NOT-A-BUG and I'm closing
this issue in our bug tracker, but you may of course continue the
discussion by replying to this.

Have a nice day,
Berny

Hello Benny

I appreciate this is not a bug if it is working as intended.

Thank you for your suggestion re -n, -v, -f
Unfortunately none of those give a warning when the target of the link doesn't exist. Is there no way for it to give a warning?

$ ln -s -v sym mydir
'mydir/sym' -> 'sym'

$ ln -s -n sym mydir

$ ln -s -n sym mydir

$ ln -s -f sym mydir


Regards, Jonny






reply via email to

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