Getting the hard link count of a directory (in Time Machine backups)
Getting the hard link count of a directory (in Time Machine backups)
- Subject: Getting the hard link count of a directory (in Time Machine backups)
- From: Martin Redington <email@hidden>
- Date: Thu, 7 Feb 2008 17:20:28 +0000
I would like to get the "true" hard link count of a directory, (to
determine if more than any hard links to the directory exists).
Normally, directories cannot be hard linked, and the link count seems
to be used as a count of the number of items in the directory.
However, my understanding is that to support Time Machine, Apple
allows hard linked directories, or their equivalent - directories are
hardlinked when their contents have not changed, to save creating
thousands of file hard links in a time machine backup.
I would like to provide "accurate" sizes of Time Machine backups, but
treating the earliest occurrence of a given inode (where "earliest"
is implied by the names of the Time Machine backup dirs) as the
"original", and counting subsequent occurrences as having zero size -
I know this isn't really what's going on with hard links, but I think
its the most intuitive presentation for the user.
I've checked most of the flags returned from fstat and
FSGetCatalogInfo, but none of the hard link flags seem to be set for
directories when I run them over my Time Machine backups.
Is there some new API to determine this status, or am I missing
something in the existing API's?
Obviously I could just check whether I've seen the inode for every
single dir, but as I'm scanning entire volumes, being able to check
whether its "true" hard link count is greater than one is a
potentially useful optimisation.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden