Re: Searching Files on MacOS X
Re: Searching Files on MacOS X
- Subject: Re: Searching Files on MacOS X
- From: "John C. Daub" <email@hidden>
- Date: Wed, 27 Aug 2003 08:10:34 -0500
>
From: Lorenzo <email@hidden>
>
Date: Wed, 27 Aug 2003 01:55:11 +0200
>
To: "Alastair J.Houghton" <email@hidden>
>
Cc: cocoa-dev <email@hidden>
>
Subject: Re: Searching Files on MacOS X
>
>
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.
This is true. It's been a long standing desire to support catalog searching
from a folder. I submitted RADAR 2856430 back in February 2002 about this
but still no movement on it that I've seen. If you really would like this
support (and it seems you do), you should submit a bugreport to Apple with
your request.
>
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?
The best you'll be able to do is manually walking the folder contents via
something like FSGetCatalogInfoBulk().
You might want to take a look at the MoreFiles sample/library code (check
Apple's web site). It has a routine called IndexedSearch() which can do just
this very thing. The only bummer about IndexedSearch() is that it uses the
old HFS routines (PBGetCatInfoSync() in this case). But once you understand
what's going on, it's not difficult to adapt that code to use
FSGetCatalogInfoBulk().
--
John C. Daub }:-)>=
<
mailto:email@hidden> <
http://www.hsoi.com/>
"Life is good, a rock sled utopia, a self-imposed myopia.
You gotta love this pace." - Dave Wyndorf
_______________________________________________
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.