Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!genrad!decvax!decwrl!pyramid!oliveb!sun!gorodish!guy From: guy@gorodish.UUCP Newsgroups: comp.unix.wizards Subject: Re: symbolic links are a botch Message-ID: <21237@sun.uucp> Date: Tue, 16-Jun-87 14:41:41 EDT Article-I.D.: sun.21237 Posted: Tue Jun 16 14:41:41 1987 Date-Received: Thu, 18-Jun-87 03:12:53 EDT References: <2629@ulysses.homer.nj.att.com> <5962@brl-smoke.ARPA> <679@nu3b2.UUCP> Sender: news@sun.uucp Lines: 37 Keywords: file system, file name resolution > What is a "symbolic" link? It is a special kind of "file". The "contents" of the file are a string representing a pathname; most references to the file are converted by the system into references to the file specified by that pathname. > Is is different from a regular link? Yes. A regular link, in effect, is a map between a file name and a particular inode on the file system where the directory containing that link resides; a symbolic link is a map between a file name and whatever file happens to have another file name. For one thing, this means that symbolic links can be made to files on other file systems. For another, if you have two hard links to a file, and do an "mv" to replace one of those links with a link to a different inode, the second hard link will still refer to the original inode, and thus the original file. If you have a symbolic link to a file, after the "mv" the symbolic link will refer to the new file. In addition, you can make symbolic links to directories; only the super-user can make hard links to directories in most UNIX systems, and even that is very much NOT recommended. (The main reason it's supported at all is that in many UNIX systems, the only way to rename a file is to make a second hard link to it with the new name, and get rid of the hard link with the old name.) > Did I miss something important in my education? 8-) Well, the more you know about various UNIX implementations, the better; for one thing, it means you can sometimes avoid reinventing the wheel (or, worse, the *square* wheel). Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com