Re: Searching Files on MacOS X
Re: Searching Files on MacOS X
- Subject: Re: Searching Files on MacOS X
- From: Lorenzo <email@hidden>
- Date: Wed, 27 Aug 2003 01:55:11 +0200
Hi,
thank you for replying,
the problem is that both the APIs PBCatSearch and FSCatalogSearch
require the container must be the root of the volume.
It's written as far as the iterator:
Currently, this iterator must be created with the kFSIterateSubtree
option and the container must be the root directory of a volume.
Instead I need to search within a folder and all its subfolders.
I tried PBCatSearch and it works really fast scanning all the disk in about
20 seconds founding thousands of files with filename "default".
Anyway I cannot scan the whole disk just to search within a simple folder
with few subfolders.
Do you know something really fast that let me choose a folder and not the
root of the disk?
Best Regards
--
Lorenzo
email: email@hidden
>
From: "Alastair J.Houghton" <email@hidden>
>
Date: Mon, 18 Aug 2003 18:56:17 +0100
>
To: Lorenzo <email@hidden>
>
Cc: email@hidden
>
Subject: Re: Searching Files on MacOS X
>
>
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.