Hard Links to directories.

mike at park.bu.edu mike at park.bu.edu
Tue Nov 27 04:30:00 AEST 1990


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



More information about the Comp.sys.sun mailing list