From owner-freebsd-questions Mon Jun 16 17:26:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA10865 for questions-outgoing; Mon, 16 Jun 1997 17:26:48 -0700 (PDT) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA10858 for ; Mon, 16 Jun 1997 17:26:43 -0700 (PDT) Received: from awfulhak.demon.co.uk (localhost [127.0.0.1]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id BAA12611; Tue, 17 Jun 1997 01:24:44 +0100 (BST) Message-Id: <199706170024.BAA12611@awfulhak.demon.co.uk> X-Mailer: exmh version 1.6.9 8/22/96 To: Christopher G Mann cc: questions@FreeBSD.ORG Subject: Re: ln behavior In-reply-to: Your message of "Sun, 15 Jun 1997 16:36:55 PDT." <199706152336.QAA04048@pooh.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 17 Jun 1997 01:24:43 +0100 From: Brian Somers Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Greetings... > > I'm curious why the "-f" parameter for "ln" does not work with directories > under FreeBSD 2.2.x. > > I.e. Files work... [.....] > But Directories don't... > > [hornet : r3cgm] ~/test - mkdir dir1 dir2 > > drwxr-xr-x 2 r3cgm r3cgm 512 Jun 15 15:34 dir1/ > drwxr-xr-x 2 r3cgm r3cgm 512 Jun 15 15:34 dir2/ > > [hornet : r3cgm] ~/test - ln -s dir1 dir.symbolic > > lrwxr-xr-x 1 r3cgm r3cgm 4 Jun 15 15:34 dir.symbolic@ -> dir1 > drwxr-xr-x 2 r3cgm r3cgm 512 Jun 15 15:34 dir1/ > drwxr-xr-x 2 r3cgm r3cgm 512 Jun 15 15:34 dir2/ > > [hornet : r3cgm] ~/test - ln -fs dir2 dir.symbolic > > lrwxr-xr-x 1 r3cgm r3cgm 4 Jun 15 15:34 dir.symbolic@ -> dir1 <-- Bzzt! > drwxr-xr-x 2 r3cgm r3cgm 512 Jun 15 15:34 dir1/ > drwxr-xr-x 2 r3cgm r3cgm 512 Jun 15 15:34 dir2/ > > I can't seem to find anything in the man pages that indicates why ln would > behave this way. > > Looking forward to your reply.. Hmm, from the man page: Given one or two arguments, ln creates a link to an existing file source_file. If target_file is given, the link has that name; target_file may also be a directory in which to place the link; otherwise it is placed in the current directory. If only the directory is specified, the link will be made to the last component of source_file. You've created "dir.symbolic/dir2 -> dir2". > -- > Christopher G. Mann - r3cgm@cdrom.com > Walnut Creek CDROM -- Brian , Don't _EVER_ lose your sense of humour....