[futurebasic] Re: [FB] CFIndexRead using FSRef

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2008 : Group Archive : Group : All Groups

From: Steve <mactech@...>
Date: Sun, 27 Jan 2008 19:37:45 -0500
On Jan 27, 2008, at 5:20 PM, Brian Stevens wrote:

> f you know the name of the file to lookup in an array, just pass the  
> file name to the iteratefolder fn and have it return the FSRef for  
> that file.

I would think that this approach is time consuming when there is  
50,000 files in a folder.  But I have not done any time comparisons.

> Must the program find it on its own without any user intervention?

Yes.  No Nav services dialog.  It is hard enough getting customers to  
do this once, let alone hundreds of times.

> Is there a starting point (i.e. starting directory) available?

Yes.  A single folder, which contains all the other folders containing  
the necessary files.

> I assume you already know how to access the file given an FSRef,  
> right?


> Please detail this if possible , and I'd really like to see the  
> corresponding WD code used to find the file under the same conditions.

Obtain the VREF of the data folder and it returns g_datafolder.
Then get the the items folder vref using :  g_item_db_folder =  
folder("items", g_datafolder)

Then open a file by name in that folder - no folder iteration is  

open "I", fileNum, index_filename,, g_item_db_folder

> No need to fill the arrays and then search the arrays

I  need to fill the data array anyways.  This approach is working and  
it proves to be faster than iterating  a folder with MANY files to  
obtain the FSRef.

Thanks again, for all your help

~ steve