Re: Testing if a folder is a bundle
Re: Testing if a folder is a bundle
- Subject: Re: Testing if a folder is a bundle
- From: Andreas Monitzer <email@hidden>
- Date: Sun, 26 Aug 2001 20:05:17 +0200
On Sunday, August 26, 2001, at 07:39 , Chris Boot wrote:
I've been trying to programmatically test whether a certain folder is a
bundle, with no success. I've tried creating a CFBundleRef from an NSURL
(I'm writing a Cocoa app) cast to a CFURLRef (this is valid), but
CFBundleCreate just happily creates bundles for folders which quite
obviously are NOT bundles. I've also tried getting the folder's finder
flags and testing for the bundle bit (which works on Mac OS 9, AFAIK), but
that doesn't work.
Is there a way of programmatically telling whether a folder should be
treated like a file? How does the Finder do it?
I don't know how the Finder does it, but [[NSWorkspace sharedWorkspace]
isFilePackageAtPath:(NSString *)fullPath]; should help.
andy
--
Description forthcoming.