Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jul 2000 18:40:36 -0500 (CDT)
From:      Mike Meyer <mwm@mired.org>
To:        Siegbert Baude <siegbert.baude@gmx.de>
Cc:        questions@FreeBSD.ORG
Subject:   Re: Replacing symbolic link to directory
Message-ID:  <14695.48116.939565.809592@guru.mired.org>
In-Reply-To: <bulk.7196.20000708094653@hub.freebsd.org>
References:  <bulk.7196.20000708094653@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> su-2.03# mkdir d1 d2
> su-2.03# ln -vs d1 d3
> d3 -> d1
> su-2.03# ls -l
> total 2
> drwxr-xr-x  2 root  wheel  512  8 Jul 11:56 d1/
> drwxr-xr-x  2 root  wheel  512  8 Jul 11:56 d2/
> lrwxr-xr-x  1 root  wheel    2  8 Jul 11:56 d3@ -> d1
> su-2.03# ln -fvs d2 d3
> d3/d2 -> d2
> su-2.03# ls -l
> total 2
> drwxr-xr-x  2 root  wheel  512  8 Jul 11:56 d1/
> drwxr-xr-x  2 root  wheel  512  8 Jul 11:56 d2/
> lrwxr-xr-x  1 root  wheel    2  8 Jul 11:56 d3@ -> d1
> su-2.03#
> 
> So nothing has been changed by "ln -fvs d2 d3". I would have expected it
> to behave exactly like:

> What ist the meaning of the output: d3/d2 -> d2     ?

That's the clue as to what's going on.  It's telling you it created a
link called "d3/d2" to the directory d2.  When the target of ln is a
directory - or a link to one - the target file is changed to be a file
with the basename of the original file. If you rerun the second
command - without the -f option - you get an error messages:

guru$ ln -vs d2 d3
ln: d3/d2: File exists

	<mike


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14695.48116.939565.809592>