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: BJ Homer <email@hidden>
- Date: Fri, 25 Sep 2009 23:23:37 -0600
> Rick,
>
> You could also use:
> NSBundle pluginBundle = [NSBundle bundleWithPath: fullPath];
>
> This will return an NSBundle object as your require or nil if fullPath does
> not identify an accessible bundle directory. So...
> if ( pluginBundle == nil ) ... then it is not a valid bundle.
>
> This isn't actually true. For example, you can create a bundle with the
path to a flat executable, and if that executable happens to have an
Info.plist embedded inside it, you can access the values in the plist as if
it were a full bundle. Likewise, if you point it at a random folder, you
may still get a valid object back. I've got some rubycocoa scripts that
take advantage of that very fact.
Sorry.
-BJ
_______________________________________________
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