| Article: |
MacFUSE: New Frontiers in File Systems | |
| Subject: | st_nlink is the number of hard links. | |
| Date: | 2007-03-19 11:21:06 | |
| From: | ralph@inputplus.co.uk | |
|
Response to: st_nlink is the number of hard links.
|
||
|
First off, when I say "directories don't have hard links", I mean you can't create a hard link to a directory (through link(2)). You are interpreting "hard link" to be synonymous with the link count of a file or directory.
|
||
Showing messages 1 through 1 of 1.
-
st_nlink is the number of hard links.
2007-03-21 14:57:17 osxbook [View]



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_nlinkfor directories. Yet, if you read one of these standards carefully enough, it is not required forst_nlinkfor directories to be what you were expecting it to be.