Re: Search Hard Drive
Re: Search Hard Drive
- Subject: Re: Search Hard Drive
- From: Alastair Houghton <email@hidden>
- Date: Sun, 16 Nov 2003 00:01:58 +0000
On 15 Nov 2003, at 21:52, Mark Davis wrote:
>
Oh, I see. So if I wanted to search for files very quickly by name I
>
should use what find command built-in to Mac OS X? Which file in
>
/usr/bin should I be using?
You might like to take a look at some of the Carbon APIs. HFS+ can be
searched *much* faster than the find command can manage, especially if
you are just searching the entire disk for a particular file.
PBCatSearchSync() and PBCatSearchAsync() look promising.
I think Finder on Jaguar uses Carbon File Manager APIs for this
purpose... Panther's Finder uses SearchKit indices when they're
enabled, and probably falls back to the Carbon APIs.
There is also a suspiciously named function in /usr/include/unistd.h,
called "searchfs()", which looks interesting but unfortunately doesn't
have a man page. There are also the fts functions, which have already
been mentioned... using them would be quite a good idea, particularly
if you want to be portable to other UN*X-like platforms in future.
Kind regards,
Alastair.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.