• 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: Tito Ciuro <email@hidden>
  • Date: Sun, 13 Jun 2004 23:22:43 +0200

Thank you Greg. This works great.

Regards,

-- Tito

On Jun 13, 2004, at 21:43, Greg Robbins wrote:

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.


References: 
 >Cocoa and resource forks (From: Tito Ciuro <email@hidden>)
 >Re: Cocoa and resource forks (From: Greg Robbins <email@hidden>)

  • Prev by Date: Re: You know you're over-caching IMPs when..
  • Next by Date: NSCalendarDate not localized
  • Previous by thread: Re: Cocoa and resource forks
  • Next by thread: Re: How can I get a checksum or reliable info at all on a file?
  • Index(es):
    • Date
    • Thread