MacFUSE: New Frontiers in File Systems
Subject:   st_nlink is the number of hard links.
Date:   2007-03-21 14:57:17
From:   osxbook
Response to: st_nlink is the number of hard links.

"Indeed I am since where I come from, UNIX, they are the same thing" ... doesn't conform to this model.

I can understand that you might be surprised by the difference in behavior, but you're assuming too much if you think that the UNIX file system style behavior is a "model" that must be conformed to.

It's more of an implementation detail: incarnations of the UNIX file system and many inode-based file systems do things that way. In fact, it is common enough behavior amongst *nix file systems that POSIX/SUSv3 are subtly ambiguous about st_nlink for directories. Yet, if you read one of these standards carefully enough, it is not required for st_nlink for directories to be what you were expecting it to be.