Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!phigate!ehviea!leo From: leo@ehviea.ine.philips.nl (Leo de Wit) Newsgroups: comp.unix.wizards Subject: Re: Hard links to directories: why not? Message-ID: <839@ehviea.ine.philips.nl> Date: 24 Jul 90 11:16:17 GMT References: <5222@milton.u.washington.edu> <6940@eos.UUCP> <1990Jul19.115622.14015@mips2.cr.bull.com> <11070@alice.UUCP> <1990Jul22.175123.5323@athena.mit.edu> <837@ehviea.ine.philips.nl> <1990Jul23.181554.17938@dg-rtp.dg.com> Reply-To: leo@ehviea.UUCP (Leo de Wit) Organization: Philips I&E Eindhoven Lines: 41 In article <1990Jul23.181554.17938@dg-rtp.dg.com> goudreau@larrybud.rtp.dg.com (Bob Goudreau) writes: | |In article <837@ehviea.ine.philips.nl>, leo@ehviea.ine.philips.nl (Leo |de Wit) writes: |> [] |> No need for that if find only - recursively - follows those |> subdirectories 'sub' for which the inode of 'sub/..' is the same as |> that of '.' ... | |... thus defeating the purpose of find, since the user doesn't get |what he expected to get (namely, the entire directory tree descending |from his specified target). But that WILL be exactly what he gets! Rejecting artificial links because those can let you traverse a structure that is anything but a tree (the simple case can indeed be an artificial link pointing to another tree, but more complicated ones could point to a tree that shares some part with the current tree, or - worse - contains the current tree). I cannot imagine the user wants looping, or trees traversed twice. | At least with symlinks, the user has an |obvious and easy way to determine whether or not a directory entry |will result in find hitting a dead-end: if "ls -l" shows that the |entry represents a symlink, then find won't traverse it. But what |does your scheme really buy that symlinks don't? You make it sound as if I would advocate the use of hard links to directories: well, not in the least. What I proposed was just a way to determine whether a directory link is a true directory (in the sense that it is consistent with '.' and '..') which optionally can be used by tree traversal algorithms, like in find. By all means, use symlinks, that's what I do too (not being superuser and such). If a user has to "ls -l" to check whether a directory entry is a symlink and as such would result in find hitting a dead-end, this strikes me as a non-obvious way, since being consequent he has to do it for the complete directory structure. Leo.