Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!ncar!mephisto!mcnc!rti!dg-rtp!larrybud.rtp.dg.com!goudreau From: goudreau@larrybud.rtp.dg.com (Bob Goudreau) Newsgroups: comp.unix.wizards Subject: Re: Hard links to directories: why not? Message-ID: <1990Aug2.172532.11026@dg-rtp.dg.com> Date: 2 Aug 90 17:25:32 GMT References: <5222@milton.u.washington.edu> <6940@eos.UUCP> <1990Jul30.153949.28122@dg-rtp.dg.com> <11110@alice.UUCP> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: goudreau@larrybud.rtp.dg.com (Bob Goudreau) Organization: Data General Corporation, Research Triangle Park, NC Lines: 35 In article <11110@alice.UUCP>, andrew@alice.UUCP (Andrew Hume) writes: > > ~ So now I'm stuck with a subdirectory that I own that lives in a > ~ directory that I can write, but I can't delete it! All I know is how > ~ many extra links to it exist -- and I have no way of finding out > ~ *where* those links are. Contrast this case to the deletion of an > ~ ordinary file with many links, and you'll see the difference. There's > ~ nothing preventing me unlinking the file, yet there is for the > ~ directory. > ~ > ~ That is the behavior I find objectionable. > > > if it were true, it would be a bummer. luckily, i couldn't > find a system where the example failed. the unlink of sub will always > work; and as the link count of sub/. is two, rmdir must stop there > and not free up the space (inode). the end result is that joe's > link to what was a dir called sub is the only one left; its all his > fault now. Hey, I wasn't saying this situation *was* true on any existing UNIX systems -- I was describing my objections to Peter da Silva's proposed implementation of directory hard links. Peter's scheme would disallow unlinking the "real" entry for a directory if the directory's link count indicated that there were other (non-primary) hard links to it. His scheme would work, but only at the expense of opening the system up to unpleasant situations like the one I described above. ------------------------------------------------------------------------ Bob Goudreau +1 919 248 6231 Data General Corporation 62 Alexander Drive goudreau@dg-rtp.dg.com Research Triangle Park, NC 27709 ...!mcnc!rti!xyzzy!goudreau USA