From owner-freebsd-questions Thu Aug 8 18:37:22 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 6B04037B400 for ; Thu, 8 Aug 2002 18:37:16 -0700 (PDT) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DAF643E77 for ; Thu, 8 Aug 2002 18:37:11 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 3DC028178D; Fri, 9 Aug 2002 11:07:08 +0930 (CST) Date: Fri, 9 Aug 2002 11:07:08 +0930 From: Greg 'groggy' Lehey To: Peter Leftwich Cc: Jerry McAllister , Matthew Seaman , Jeff Jirsa , John Bleichert , FreeBSD LIST , Roman Neuhauser Subject: Re: Links (was: Is simplicity despised? WAS: Message-ID: <20020809013708.GC39322@wantadilla.lemis.com> References: <20020808234634.GJ8561@wantadilla.lemis.com> <20020808211403.W85736-100000@earl-grey.cloud9.net> <20020808141523.GT281@freepuppy.bellavista.cz> <20020808211101.G85736-100000@earl-grey.cloud9.net> <200208081409.g78E9WG14094@clunix.cl.msu.edu> <20020808210908.O85736-100000@earl-grey.cloud9.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020808211403.W85736-100000@earl-grey.cloud9.net> <20020808211101.G85736-100000@earl-grey.cloud9.net> <20020808210908.O85736-100000@earl-grey.cloud9.net> User-Agent: Mutt/1.3.99i Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 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 On Thursday, 8 August 2002 at 21:10:31 -0400, Peter Leftwich wrote: > On Thu, 8 Aug 2002, Jerry McAllister wrote: >> Hi, 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). And really, symlinks are not so unbearably wasteful >> unless you are running some very intensive applications. >> ////jerry > > Which came first, the less or the more? ;-) more. > Why would intensive apps matter? I don't understand the question. > Is it a RAM issue, No. > or like Windows shortcuts? What are they? On Thursday, 8 August 2002 at 21:12:20 -0400, Peter Leftwich wrote: > On Thu, 8 Aug 2002, Roman Neuhauser wrote: >> 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. > > This thread leaves one craving simplicity -- anyway, a question. > > So can you delete one and not have both disappear? For some definition of "delete", yes. UNIX doesn't use the word "delete". At the system level, it's unlink. At the user level, it's either "unlink" or "remove". As the name suggests, it removes a link. The system removes the inode and the data when nothing more (neither a link nor an open file) references the data. > I think it would be very quirky and perhaps rude of FreeBSD if a > user did an `rm more` and less went with it! Indeed. On Thursday, 8 August 2002 at 21:21:51 -0400, Peter Leftwich wrote: > On Fri, 9 Aug 2002, Greg 'groggy' Lehey wrote: >>> Yup. But was that file created as less or more >> Why should you care? >>> and if I want to make a change do I start with the source for less or more, etc? >> It's the same source. > > Good point(s). > >>> Minor maybe, but ln -s makes it clear and is not so onerrous in most situations. >> 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 > > Mmm hmm. > >> 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 > > Ah haaaaaaa. *lightbulb goes on* > >> UNIX files consist of three components: the data, the inode and the >> name. The inode is what really describes the file, and where nearly >> all the information is stored that you see when you run ls -l (only > > So on Macs, what is with those hidden DESKTOP and (something else) files > that store stuff such as when a user saves an image from a website, then > does Command-I on it and can see what the URL was to that image > originally? I don't know. Mac semantics are very different from UNIX. > I LOVE that feature of MacOS (about the only thing I'd say I love) :) > > I thought you had to use ls -ali (include the i that is) to see such >info? The i just gives you the inode number. But all the other information is stored in the inode. >> the name is stored in a directory). This is the only part of a file >> which *must* exist. An empty file doesn't have any data. > > Ya lost me. Which part must exist? The inode. That's what defines the file. >> Strictly speaking, the name isn't necessary unless you want to open >> the file. If it's already open, you can remove the name and still >> access the file, but it will go away if you close it for the last >> time. > > Doesn't what happens depend on what program is accessing the file? No. Greg -- Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message