Re: Correct way to tell if a path is to a .bundle?
Re: Correct way to tell if a path is to a .bundle?
- Subject: Re: Correct way to tell if a path is to a .bundle?
- From: Peter Ammon <email@hidden>
- Date: Fri, 25 Sep 2009 17:15:45 -0700
On Sep 24, 2009, at 8:09 PM, Jens Alfke wrote:
On Sep 24, 2009, at 6:41 PM, Rick Mann wrote:
I'm scanning a directory for plugins for my app. Given a path,
what's the right way to tell if it's a path to a bundle?
-[NSWorkspace isFilePackageAtPath:].
Actually, bundles are often packages, and vice versa, but you can be
either without the other.
A file package is a directory that is presented as a single file to
the user, while a bundle is a directory with a particular layout. For
example, frameworks are bundles, but not packages. If you navigate to
a .framework file in Finder, you will see that it looks like a
folder. Likewise, you can take any directory and set the package bit,
and it becomes a package.
The usual way is to just try loading the URL as a bundle, and see if
you succeed. You could also define a particular extension for your
plugin type, and look for files of that extension, with the assistance
of CFBundleCreateBundlesFromDirectory.
-Peter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden