Re: Scripting Additions: Embracing the Horror of Unix
Re: Scripting Additions: Embracing the Horror of Unix
- Subject: Re: Scripting Additions: Embracing the Horror of Unix
- From: John W Baxter <email@hidden>
- Date: Sat, 2 Feb 2002 20:48:40 -0800
At 20:36 -0700 2/2/2002, garbanzito wrote:
>
it's hard to have confidence in that when 1) it doesn't
>
mention hard links or aliases, 2) it doesn't talk about
>
whether it *follows* links when traversing directories with
>
-R, and 3) some other man pages are missing some Mac OS
>
X-specific info.
On a Unix sort of file system (there really isn't a "the Unix file
system"), rm removes the hard link. That reduces the actual file's count
of links by 1...if it has reached zero the file is actually removed. So
there's really no point in mentioning that case in the man page.
But if the file is hard linked in some other directory, reducing the count
doesn't reach zero. Same result if some process has the file open (since
that increases the link count).
I have no idea how Apple has managed to make HFS+ look like it works that
way (or if it does look like it works that way).
man unlink
(which describes a C language call, not a shell command) may be of
interest, since it describes things well. (I don't know how Apple has made
that apply to HFS+ file systems, either...note that the man unlink page
carries a 1993 date: somewhat before Apple cared.)
--John
--
John Baxter email@hidden Port Ludlow, WA, USA