Re: How to get all the path of an application present on the disk
Re: How to get all the path of an application present on the disk
- Subject: Re: How to get all the path of an application present on the disk
- From: Jerry Krinock <email@hidden>
- Date: Thu, 21 Mar 2013 07:39:35 -0700
On 2013 Mar 20, at 10:57, Matt Neuburg <email@hidden> wrote:
> I recently broke my own app … by turning off Spotlight!
Nice, Matt! Yes, Spotlight is great - when it works - but I've always felt that it was a tad presumptuous of Apple to provide an API for *developing* with it. It's fuzzy even when it's *on*.
To the original question, I don't think there's an easy way to do this. I don't think Launch Services remembers any more than the most recently-recognized version.
The only way to do this may be to search the whole drive, stopping each time you find a directory (package) which looks like an app (.app extension, presence of Contents/Info.plist, etc.), and examining the CFBundleIdentifier in that Info.plist.
It can be done using PBCatalogSearchAsync(), as in these demos…
https://github.com/jerrykrinock/ClassesObjC/blob/master/SSYCarbonSearcher.m
https://github.com/jerrykrinock/SSYCarbonSearcher
but such a search takes minutes, not seconds, especially for a large non-SSD mechanical drive.
_______________________________________________
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