• 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
Re: CatalogSearch - how to find hard links?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CatalogSearch - how to find hard links?


  • Subject: Re: CatalogSearch - how to find hard links?
  • From: James Bucanek <email@hidden>
  • Date: Fri, 25 Apr 2008 14:57:16 -0700

Thomas Tempelmann <mailto:email@hidden> wrote (Friday, April 25, 2008 11:11 AM +0200):

On 25.04.2008 19:41 Uhr, "James Bucanek" <email@hidden> wrote:

You want to include fsCatInfoNodeFlags in
whichInfo then examine the FSCatalogInfo.nodeFlags field. You're
looking for the kFSNodeHardLinkbit/kFSNodeHardLinkMask.

That would only give me the information _that_ it's a hard link, but not what its siblings are. How would I identify its siblings? I can't find any part in the returned structures that could tell me such a thing.

Sorry, I misunderstood. I don't think you can find that out from the Core APIs. I believe that you have to revert to the BSD APIs and get the inode number. What my code does is use the kFSNodeHardLinkMask to determine that the file is, in fact, a hard link, it then converts the FSRef into a path, and performs an lstat() to obtain its (simulated) inode number of the file. Building a dictionary keyed by inode number lets me quickly match up the files that are hard links of each other.
--
James Bucanek


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: CatalogSearch - how to find hard links? (From: Thomas Tempelmann <email@hidden>)

  • Prev by Date: Re: AFP functions 76 and 79
  • Next by Date: Re: AFP functions 76 and 79
  • Previous by thread: Re: CatalogSearch - how to find hard links?
  • Next by thread: Re: CatalogSearch - how to find hard links?
  • Index(es):
    • Date
    • Thread