Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.wizards Subject: Re: Hard links to directories: why not? Message-ID: <7191@star.cs.vu.nl> Date: 30 Jul 90 20:32:40 GMT References: <5222@milton.u.washington.edu> <6940@eos.UUCP> <1990Jul24.200022.2265@dg-rtp.dg.com> <1990Jul30.153949.28122@dg-rtp.dg.com> Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 29 In article <1990Jul30.153949.28122@dg-rtp.dg.com>, goudreau@larrybud.rtp.dg.com (Bob Goudreau) writes: )... )1) I create a subdirectory named "sub". ) )2) Unbeknownst to be me, Joe Schmo creates a hard link of his own ) to "sub". ) )3) I try to rmdir "sub", which is empty, and find that I cannot, ) because its link count is > 2. ) )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. There's hardly a difference; things really get nice if quotas are enabled... )That is the behavior I find objectionable. Indeed. Perhaps another file attribute could be of service here: permission to make a hard link. Or get rid of hard links altogether and use symlinks instead. -- "and with a sudden plop it lands on usenet. what is it? omigosh, it must[...] be a new user! quick kill it before it multiplies!" (Loren J. Miller)