Re: Searching Files on MacOS X
Re: Searching Files on MacOS X
- Subject: Re: Searching Files on MacOS X
- From: "Alastair J.Houghton" <email@hidden>
- Date: Mon, 18 Aug 2003 18:56:17 +0100
On Monday, August 18, 2003, at 06:30 pm, Lorenzo wrote:
do you know why the Finder performs a search much much faster than my
Cocoa
application?
The Carbon API has many functions that take advantage of the design of
the HFS and HFS Plus filesystems in a way that isn't easily possible
using BSD-like APIs. You might be interested to compare (for example)
the performance of the "find" utility, a BSD program, with the
Finder... I think you'll find the results are similar.
[snip]
What is the fastest way to search for files?
If you're actually searching, the answer is probably the Carbon
PBCatSearch, PBCatalogSearch and FSCatalogSearch APIs. If you're just
enumerating (i.e. you want to see every file), you might be better off
using e.g. FSGetCatalogInfoBulk().
See
http://developer.apple.com/documentation/Carbon/Reference/File_Manager/
file_manager/function_group_45.html#//apple_ref/doc/uid/TP30000107/
Searching_a_Volume and
http://developer.apple.com/documentation/Carbon/Reference/File_Manager/
file_manager/function_group_46.html#//apple_ref/doc/uid/TP30000107/
Searching_a_Volume_Using_a_Catalog_Iterator
Kind regards,
Alastair.
_______________________________________________
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.