• 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: Cocoa and resource forks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa and resource forks


  • Subject: Re: Cocoa and resource forks
  • From: Greg Robbins <email@hidden>
  • Date: Sun, 13 Jun 2004 12:43:26 -0700

At 8:45 PM +0200 6/13/04, Tito Ciuro wrote:
>If I embed this function call in my Cocoa code, is it a safe way to determine whether a file has a resource fork?

CountTypes assumes you've opened the resource file already. Try something like this instead:

BOOL HasResourceFork(NSString *path)
{
Boolean isDir;
FSRef ref;
OSStatus err = FSPathMakeRef([path fileSystemRepresentation], &ref, &isDir);
if (err == noErr)
{
FSCatalogInfo catInfo;
err = FSGetCatalogInfo(&ref, kFSCatInfoRsrcSizes, &catInfo, NULL, NULL, NULL);
if (err == noErr)
{
return (catInfo.rsrcLogicalSize > 0);
}
}
return NO;
}

Greg Robbins
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Cocoa and resource forks
      • From: Tito Ciuro <email@hidden>
References: 
 >Cocoa and resource forks (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Re: Stupid question: selected object of an array controller
  • Next by Date: How can I get a checksum or reliable info at all on a file?
  • Previous by thread: Cocoa and resource forks
  • Next by thread: Re: Cocoa and resource forks
  • Index(es):
    • Date
    • Thread