On Sep 25, 2009, at 17:15:45, Peter Ammon wrote:
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.
Unfortunately, I don't think CFBundleCreateBundlesFromDirectory() will
work for me. It creates CFBundleRefs, not NSBundles, and it loads
them, which I want to avoid if possible.
I think I just have to check the filenames' extensions as I iterate
them.
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com