Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!hp4nl!phigate!ehviea!leo From: leo@ehviea.ine.philips.nl (Leo de Wit) Newsgroups: comp.unix.wizards Subject: Re: Why aren't (hard) links to symbolic links allowed? Message-ID: <715@ehviea.ine.philips.nl> Date: 9 May 90 19:50:06 GMT References: <874@nlsun1.oracle.nl> <1990May9.171340.5351@ucselx.sdsu.edu> Reply-To: leo@ehviea.UUCP (Leo de Wit) Organization: Philips I&E Eindhoven Lines: 26 In article <1990May9.171340.5351@ucselx.sdsu.edu> g-patena@steer.UUCP (Mitch Patenaude) writes: |In article <874@nlsun1.oracle.nl> bengsig@oracle.nl (Bjorn Engsig) writes: |[stuff deleted] |>........................... Shouldn't I be able to have more than one (hard) |>link to a file that happens to be a symbolic link? If no, then why not? | No.. in fact.. you don't even have one hard link... a symbolic link is |just a specialized direcotry entry which makes reference to another |filename (not even the i-node.. just the filename.. if the file it |references is moved or deleted.. the link does not follow it).. while a |hard link makes another link to the i-node (and becomes indistinguishable |from the files it's linked to.) but the sybolic link has no i-node of it's |own.. only the referce to another file.. which is where the link is made. And where do you think this reference resides? Directory entries are just (filename,inode) number pairs, nothing specialized here. The symbolic link is characterized thus by the mode bits of the inode (S_IFLNK from ) ; the 'reference to another file' is contained in the disk blocks for this special file. Bjorn's question seems a valid one; a rename() emulated by a link()/unlink() pair fails for the above reason in the case of a symbolic link (one is left with a hard link to the original softlinked-to file, instead of a different name for the previous soft link). Leo.