Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!date '+%m/%d/%y %H:%M:%S'brchs1!bnr.ca!rice.edu!sun-spots-request From: mike@park.bu.edu Newsgroups: comp.sys.sun Subject: Hard Links to directories. Keywords: SunOS Message-ID: <446@brchh104.bnr.ca> Date: 26 Nov 90 17:30:00 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 14 Approved: Sun-Spots@rice.edu X-Original-Date: Sun, 11 Nov 90 14:55:58 -0500 X-Sun-Spots-Digest: Volume 9, Issue 376, message 8 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu Sun OS 4.0 has a provision to allow hard links to directories. Hard linked directory paths appear to work appropriately, fsck -n works appropriately. I have discoved however the following problem with their use. Suppose one wants to delete two hard linked directories. Presumably one attempts to remove the contents of the directory. Attempts to rmdir either of the pair of hard linked directories fails because of the link count of the directory is bumped. Rmdir fails it appears on either of the links because it interpets the directory as non-empty. The link count on these directories have been bumped. A rm -r fails because the directory cannot be removed unless it's link is removed The only way I could find to remove a pair of hard linked directories is to run fsck on the directories. FSCK complains about extraneous link file which it now knows how to remove. Is there any way to remove hard linked directories under Sun OS 4.0 other than by running fsck? -mike