Date: Fri, 9 Aug 2002 11:12:10 -0400 (EDT) From: Jerry McAllister <jerrymc@clunix.cl.msu.edu> To: grog@FreeBSD.ORG (Greg 'groggy' Lehey) 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) Subject: Re: Links (was: Is simplicity despised? WAS: Message-ID: <200208091512.g79FCAN19969@clunix.cl.msu.edu> In-Reply-To: <20020808234634.GJ8561@wantadilla.lemis.com> from "Greg 'groggy' Lehey" at Aug 09, 2002 09:16:34 AM
next in thread | previous in thread | raw e-mail | index | archive | help
> >>> > >>> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208091512.g79FCAN19969>