From owner-freebsd-questions Sat Jul 8 16:41:18 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (zoom1-180.telepath.com [216.14.1.180]) by hub.freebsd.org (Postfix) with SMTP id 45A5A37B639 for ; Sat, 8 Jul 2000 16:41:13 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 91570 invoked by uid 100); 8 Jul 2000 23:40:36 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14695.48116.939565.809592@guru.mired.org> Date: Sat, 8 Jul 2000 18:40:36 -0500 (CDT) To: Siegbert Baude Cc: questions@FreeBSD.ORG Subject: Re: Replacing symbolic link to directory In-Reply-To: References: X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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