Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!bloom-beacon!jik From: jik@pit-manager.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.wizards Subject: Re: Hard links to directories: why not? Message-ID: <1990Jul22.175123.5323@athena.mit.edu> Date: 22 Jul 90 17:50:59 GMT References: <5222@milton.u.washington.edu> <6940@eos.UUCP> <1990Jul19.115622.14015@mips2.cr.bull.com> <11070@alice.UUCP> Sender: daemon@athena.mit.edu (Mr Background) Organization: /mit/jik/.organization Lines: 25 In-Reply-To: andrew@alice.UUCP's message of 20 Jul 90 05:27:58 GMT In article <11070@alice.UUCP> andrew@alice.UUCP (Andrew Hume) writes: on the other hand, links to files already do that to some extent. and symbolic links do it completely as you can symlink to directories. allowing hard links to dirs makes the problem no worse, really. Actually, it makes it much worse. Symbolic links can be quite easily detected by any program that is concerned about circular filesystem structures, since a symbolic link has a different file type from the file to which it points. However, there is no way for a program to easily detect, without keeping lots of internal state showing which inodes have already been visited, when it is reading a hard link. Hard links are no different from normal files. For example, "find" has no trouble at all dealing with symbolic links, but it can quite easily get into a looping state if it encounters a hard-linked directory pointing higher up in the directory structure. Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710