hard links to directories

Eric Hanchrow yamada-sun!eric at nosun.west.sun.com
Sat Dec 2 06:55:41 AEST 1989


SunOS 4.0.3, Sun4/260

A while ago, out of curiosity, I made a hard link to one of my
directories.  After I got bored with it, I decided to get rid of one of
the links... and couldn't.  I tried `\rm -f', `unlink', and `rmdir'.
Curiously, `rmdir' reported that the directory was not empty, even though
it was.  Is it possible that `rmdir' looks at the number of links to a
directory, and if that number is > 2, it assumes that the directory is not
empty?

Anyhow, I never could get rid of either of the links, so I swept them
under the rug by putting them in /tmp, giving them funny names, changing
their owners to `nobody', and changing their permissions to 0.

Any brilliant commentary explaining this odd behavior would be
appreciated.

|Eric Hanchrow          yamada-sun!eric at nosun.west.sun.com              |
|Phase III Logic, Inc.  ...!{tektronix, sun}!nosun!yamada-sun!eric      |



More information about the Comp.sys.sun mailing list