Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: rang@cpsin3.cps.msu.edu (Anton Rang) Newsgroups: comp.sys.sun Subject: How to unlink a directory? Keywords: SunOS Message-ID: <8904061853.AA28904@cpsin3.cps.msu.edu> Date: 25 Apr 89 22:37:20 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 12 Approved: Sun-Spots@rice.edu Original-Date: Thu, 6 Apr 89 14:53:24 EDT X-Sun-Spots-Digest: Volume 7, Issue 248, message 9 of 13 I have some directories with multiple hard links. I'd like to remove one of the hard links. Sounds simple, right? How do I do it? Calling unlink() returns EPERM (even as superuser).... Thanks! For example: /abc/def/ghi is hard-linked to /abc/xxx/ghi (via ln -f) How to remove the /abc/def/ghi link? [[ I believe that "fsck" is your only recourse. See v7n120 for details on a bug in "rename" that can unintentionally place you in this situation. --wnl ]]