Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!princeton!allegra!alice!dmr From: dmr@alice.UUCP Newsgroups: comp.unix.wizards Subject: Re: symbolic links are a botch Message-ID: <7011@alice.UUCP> Date: Mon, 22-Jun-87 02:45:50 EDT Article-I.D.: alice.7011 Posted: Mon Jun 22 02:45:50 1987 Date-Received: Tue, 23-Jun-87 01:33:19 EDT Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 49 Symbolic links are indeed for the most part a botch, because they disturb the near tree shape that convention gives to the Unix file system. Trees are easily understood both by people and by programs; more complicated shapes are not. Already, even in the traditional file system, the existence of shared leaves (hard links) causes a certain amount of confusion. With symbolic links the situation is considerably messier because the shape is that of a general graph (not a DAG). For the most part, the BSD and V8 conventions for dealing with symbolic links are well-chosen, but there has still been a significant increase in complexity; this is indicated, for example, by continual questions about which operations should follow links, and which should not. Even if all the questions are given a satisfactory answer, their existence suggests that something is wrong. Nevertheless, symbolic links are sometimes useful, mainly because the attractive and well-controlled tree-shaped file system does not always map well onto real disks or remote machines. Unix makes it easy to move a node in the file system tree and its descendants to a separate disk partition or perhaps to another machine, but not to put several such nodes into one partition unless their parent and all their siblings are there as well. If we are to have symbolic links, I would, therefore, like to make them as obvious as possible instead of as transparent as possible, because they cannot be transparent; they introduce a new and not easily comprehended structure. That is, I would like people to be able to think of the file system as truly a tree (albeit with readily understood annotations like `..') and to have any symbolic links understandable as abbreviations or macros used in naming the actual structure. Thus it disturbs me not at all that our pwd gives one's actual location in the tree. In particular, Korn's proposal to reinterpret the meaning of .. depending on the history of the process seems unfortunate, because `..' no longer has any meaning with repect to the hierarchy; indeed, there no longer is any hierarchy. (Thoughts about `...' seem only to make matters worse). Another way to put this is that the proposal promises more than it can possibly deliver; it does make certain local operations like `pwd; cd symlink; pwd' behave more as they would if the graph were a tree, at the cost of concealing the global structure. The simulation of the tree has further peculiarities: `ls symlink/..' and `cd symlink; ls ..' still behave differently. The real problem is the symbolic links themselves, but I think the proposal exacerbates it rather than relieves it. Dennis Ritchie