• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting the hard link count of a directory (in Time Machine backups)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • [OT] Re: Getting the hard link count of a directory (in Time Machine backups)
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: [OT] Registration Scheme Versioning
  • Next by Date: Re: Understanding objc_assign_strongCast
  • Previous by thread: [OT] Registration Scheme Versioning
  • Next by thread: [OT] Re: Getting the hard link count of a directory (in Time Machine backups)
  • Index(es):
    • Date
    • Thread