Xref: utzoo news.groups:13841 comp.unix.questions:17314 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: news.groups,comp.unix.questions Subject: symlinks, pointers & GOTO's (was: Re: accelerated philosophers) Message-ID: <4394@solo5.cs.vu.nl> Date: 31 Oct 89 22:35:07 GMT References: <21042@gryphon.COM> <2952@splut.conmicro.com> <21076@gryphon.COM> <3757@pinas.cs.vu.nl> <2173@frog.UUCP> <3823@solo1.cs.vu.nl> <1989Oct28.153220.27427@world.std.com> Followup-To: comp.unix.questions Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 31 This article is crossposted to comp.unix.questions, to which followups have been directed. bzs@world.std.com (Barry Shein) writes: \>A symbolic link is a POINTER to a file, | [...] \> a hard link is the file system's GOTO. | [...] \ \huh? a symbolic link is a call by name and a hard link is a call by \reference. Your analogy has conformability problems. To get this straight once and for all: I wanted to point out how neatly symlinks can be used, compared to hard links. Symbolic links are often regarded as hacks to link across devices only. But compare them with pointers: what do you use pointers for, aren't you glad they exist? Pointers always make me think of *shared* data. Of course one might object: multiple hard links allow data to be shared too. Quite so, but hard links have the following not-so-neat property: when you want to replace a multiply hard-linked file with an updated version, you have to *cat* the new file over the old one; using mv will lead to `interesting' effects... Of course symlinks have a drawback too: when you move the file pointed to, you have to adjust the symlink as well, *if* you want it still to point to the original data. The cross-device link problems can be overcome if the file system uses a universal inode (vnode) scheme: don't let every partition have the same set of inode numbers, instead let each have a private non-overlapping share of inodes. Symlinks, however, still have their use. -- A symbolic link is a POINTER to a file, | Maarten Litmaath @ VU Amsterdam: a hard link is the file system's GOTO. | maart@cs.vu.nl, mcsun!botter!maart