Re: Cocoa and resource forks
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.