advertisement

Article:
  MacFUSE: New Frontiers in File Systems
Subject:   st_nlink is the number of hard links.
Date:   2007-03-14 23:30:00
From:   osxbook
Response to: st_nlink is the number of hard links.

Ralph, what Scott wrote is correct.


Directories don't have hard links on Mac OS X (well, not yet), or on any typical Unix system for that matter. The rationale is that with directory hard links, it would be all too easy to create cycles.


st_nlink *would* be the number of hard links, but for files. Looks like the man page for stat(2) fails to mention that.


On Mac OS X, for directories, you can either set st_nlink to the number of objects within the directory ("." and ".." + the rest), or if the volume is such that the number is hard to calculate, you can set st_nlink to 1.


-A


1 to 1 of 1
  1. st_nlink is the number of hard links.
    2007-03-15 07:33:36  ralph@inputplus.co.uk [View]

    • st_nlink is the number of hard links.
      2007-03-16 01:35:52  osxbook [View]

      • st_nlink is the number of hard links.
        2007-03-19 11:21:06  ralph@inputplus.co.uk [View]

        • st_nlink is the number of hard links.
          2007-03-21 14:57:17  osxbook [View]

1 to 1 of 1