From owner-freebsd-questions Fri Aug 9 8:12:21 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 009F237B400; Fri, 9 Aug 2002 08:12:15 -0700 (PDT) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0009843E5E; Fri, 9 Aug 2002 08:12:13 -0700 (PDT) (envelope-from jerrymc@clunix.cl.msu.edu) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.11.6+Sun/8.11.6) id g79FCAN19969; Fri, 9 Aug 2002 11:12:10 -0400 (EDT) From: Jerry McAllister Message-Id: <200208091512.g79FCAN19969@clunix.cl.msu.edu> Subject: Re: Links (was: Is simplicity despised? WAS: To: grog@FreeBSD.ORG (Greg 'groggy' Lehey) Date: Fri, 9 Aug 2002 11:12:10 -0400 (EDT) Cc: jerrymc@clunix.cl.msu.edu (Jerry McAllister), neuhauser@bellavista.cz (Roman Neuhauser), Hostmaster@Video2Video.Com (Peter Leftwich), m.seaman@infracaninophile.co.uk (Matthew Seaman), jeff@unixconsults.com (Jeff Jirsa), syborg@stny.rr.com (John Bleichert), FreeBSD-Questions@FreeBSD.ORG (FreeBSD LIST) In-Reply-To: <20020808234634.GJ8561@wantadilla.lemis.com> from "Greg 'groggy' Lehey" at Aug 09, 2002 09:16:34 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > >>> > >>> Because symlinks make it abundantly clear what is linked to what. > >>> Hard links can lead to confusion. I suppose that's not a problem > >>> For most of you though. But, for example, if a person doesn't know > >>> which is linked to which, that person wouldn't know that more is > >>> really less. They might think less is really more (if they discovered > >>> it at all). > >> > >> No, less is not hardlinked to more, nor is more hardlinked to less. > >> They're two names for the same file. > >> > >> So... Yes, you're right: less is really more. But at the same time, > >> more is less. > > > > Yup. But was that file created as less or more > > Why should you care? I care if I want to know how to change what the file is. Do I rebuild more or less in this case? Probably less interesting for such basic omnipresent system or shell stuff than for stuff I am making myself and trying to keep track of. > > > and if I want to make a change do I start with the source for less > > or more, etc? > > It's the same source. No, there is a source for more and a source for less -- somewhere. > > Minor maybe, but ln -s makes it clear and is not so onerrous in > > most situations. By onerous, I mean the extra resource and possible problems are not so onerous a penalty for most use. If the use if heavy then possibly the extra CPU and disk resource may mean something and a hard link is then needed. > No, symlinks impose an order, and they don't clarify, they obfuscate. > If you do this, you'll end up with a broken symlink: > > $ echo foo > bar > $ ln -s bar baz > $ rm bar > $ cat baz > cat: baz: No such file or directory > $ > > On the other hand, links are *the* basic mechanism for naming files. > If you do this, it will work: > > $ echo foo > bar > $ ln bar baz > $ rm bar > $ cat baz > foo Sure. and if I do: # echo joes stuff > ./home/joe.stuff # echo freds stuff > ./home/fred.stuff # ln joe ./home/jor.stuff # ln fred ./home/joe.stuff # rm joe # cat fred joes stuff "Oh Oh better fix that" # vi fred c$freds stuff ESC:wq # cat ./home/joe.stuff freds stuff A user error less likely to happen with a symlink since they show up so obviously in an ls -l. Hard links have their place. But, symlinks needn't be so quickly dismissed. ////jerry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message