• 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: Best way to discover resource forks?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to discover resource forks?


  • Subject: Re: Best way to discover resource forks?
  • From: Steve Christensen <email@hidden>
  • Date: Tue, 11 Jul 2006 12:40:45 -0700

You weren't really clear (at least to me) if you're looking for files that have a resource fork, or files that contain resources that could be in either the resource or data fork of the file. For the former case, as Ryan said you can call FSGetCatalogInfo with kFSCatInfoRsrcSizes specified.

If you're trying to determine if a file contains resources (in either fork), you'd need to try opening the fork(s) using Resource Manager APIs, which would be considerably more time consuming.

steve


On Jul 11, 2006, at 11:31 AM, Ryan Britton wrote:

As far as I know, there is no Cocoa way to specifically check for the presence of a resource fork. I'm not sure how quick FSIterateForks is, but you may be able to get by using FSGetCatalogInfo() and asking for kFSCatInfoRsrcSizes in the whichInfo field. If you're enumerating a directory, you can also get a speed boost by using an FSIterator and the Bulk variation of this function. A Cocoa implementation of this latter approach can be found here (UKDirectoryEnumerator): http://www.zathras.de/ angelweb/sourcecode.htm


On Jul 11, 2006, at 10:50 AM, Scott Ellsworth wrote:

I want to write a file scanner that will tell me which of my files have resource forks. The File Manager APIs give me FSIterateForks, which should work. Is this the most cocoa- friendly way to accomplish this task?

The rsync Apple ships has a critical bug, in that it improperly sets the modified time to 'now' if run with extended attributes/ resource preservation. I want a way to know which files need special handling.

I am open to command line tools, or other APIs, if they will cause me less grief in the long run.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Best way to discover resource forks?
      • From: Scott Ellsworth <email@hidden>
    • Re: Best way to discover resource forks?
      • From: Chris Suter <email@hidden>
References: 
 >Best way to discover resource forks? (From: Scott Ellsworth <email@hidden>)
 >Re: Best way to discover resource forks? (From: Ryan Britton <email@hidden>)

  • Prev by Date: Re: Best way to discover resource forks?
  • Next by Date: Re: Out-of-order Undos and NSTextField [SOLVED, well sort of]
  • Previous by thread: Re: Best way to discover resource forks?
  • Next by thread: Re: Best way to discover resource forks?
  • Index(es):
    • Date
    • Thread