On Jan 27, 2008, at 5:37 PM, Steve wrote: > > 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. 50,000 files in a folder is truly a lot. There are other methods, plus have you reviewed FSCatalogSearch with an iterator? It allows partial and full name searches, searches based on access dates and more. My IterateFolders example was not meant to be an ultimate solution for all file searches, just an example of one method. In my own code I save off the FSRef of the folder I need and don't try to process the folder and its files in the same pass. You might have to experiment with what works best with 50,000 files in a folder. Maybe save the pointer to the array of FSRefs of 50,000 files and build a binary search of the array. I haven't tried FSCatalogSearch myself, so it might be faster than building your own search - don't know. > >> 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. That should make it easier once the program obtains the FSRef of this single folder. > >> 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 > necessary. > > open "I", fileNum, index_filename,, g_item_db_folder I'd like to see the code that does this. Studying the File Manager (and I did need to do that to write some of the FBtoC file support) made me realize Apple has been very careful not to remove functionality. It might have to be done a different way. But it is still there. Brian S.