Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Searching files in a folder !



Hi,

I am looking for some help searching files on Mac OS X !!
First question is which function should I use out of the following:
<x-tad-bigger>
FSCatalogSearch() or
PBCatalogSearchSync() or
PBCatalogSearchAsync()

What is the difference I could not understand from the Apple documentation maybe I have limited understanding.
I tried to play around with PBCatalogSearchSync() function and tried to search for the files in a folder but the confusing part was this documentation...

</x-tad-bigger>
"Currently, this iterator must be created with the <x-tad-bigger>kFSIterateSubtree</x-tad-bigger> option and the container must be the root directory of a volume. See <x-tad-bigger>FSIterator</x-tad-bigger> for more information on the <x-tad-bigger>FSIterator</x-tad-bigger> data type."

What does this mean ?
Does this mean that the folder user selects to search should be like "Macintosh HD:Folder1"
and deeper levels will fail like "Macintosh HD:Folder1:Folder2"

Confused by above I tried searching the volume as follow:
/* spec is the FolderSpec */
err = FSGetVolumeInfo( spec->vRefNum, 0, NULL, kFSVolInfoNone, NULL, NULL, &rootFSRef );
err = FSOpenIterator( &rootFSRef, kFSIterateSubtree, &iterator );

But this will search the files on whole volume which may take a lot of time and then I have to filter the files for the user selected folder ?

Please advice !!
Thanks
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.