From owner-freebsd-bugs Thu Jun 20 13:50:22 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 37D7737B406 for ; Thu, 20 Jun 2002 13:50:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5KKo3p68739; Thu, 20 Jun 2002 13:50:03 -0700 (PDT) (envelope-from gnats) Date: Thu, 20 Jun 2002 13:50:03 -0700 (PDT) Message-Id: <200206202050.g5KKo3p68739@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Crist J. Clark" Subject: Re: i386/39584: ln -f fails to unlink Reply-To: "Crist J. Clark" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR i386/39584; it has been noted by GNATS. From: "Crist J. Clark" To: Steve Follmer Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: i386/39584: ln -f fails to unlink Date: Thu, 20 Jun 2002 13:43:25 -0700 On Thu, Jun 20, 2002 at 12:02:41PM -0700, Steve Follmer wrote: [snip] > >Description: > ln -f is supposed to force the unlink of the target directory. > It fails to do so and also reports no error. > > man ln claims... > -f If the target file already exists, then unlink it so that the link may occur. > > >How-To-Repeat: > edge1# mkdir d1 > edge1# mkdir d2 > edge1# ln -s l1 d1 > edge1# ls -l > total 4 > drwxr-xr-x 2 root wheel 512 Jun 20 11:13 d1 > drwxr-xr-x 2 root wheel 512 Jun 20 11:12 d2 > edge1# ln -s d1 l1 > edge1# ls -l > total 4 > drwxr-xr-x 2 root wheel 512 Jun 20 11:13 d1 > drwxr-xr-x 2 root wheel 512 Jun 20 11:12 d2 > lrwxr-xr-x 1 root wheel 2 Jun 20 11:13 l1 -> d1 > edge1# ln -fs d2 l1 > edge1# ls -l > total 4 > drwxr-xr-x 2 root wheel 512 Jun 20 11:13 d1 > drwxr-xr-x 2 root wheel 512 Jun 20 11:12 d2 > lrwxr-xr-x 1 root wheel 2 Jun 20 11:13 l1 -> d1 You missed it. # ls -l d1 total 0 lrwxr-xr-x 1 root wheel 2 Jun 20 11:13 l2 -> d2 lrwxr-xr-x 1 root wheel 2 Jun 20 11:13 l1 -> l1 When you run the last 'ln -fs d2 l1,' you are making a symbolic link to "d2" _inside_ l1. l1 is a symlink to d1, which is where the link was successfully made. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message