[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 08:32:51 -0500
So now that I can Iterate a folder using FSrefs, I would like to know  
what is the fastest way to access a specific file in a designated  
folder.  The folder may contain many thousands of files.

Using those god awful working dirIDs vref hacks with FB, it was very  
easy to do.

Brian, you showed me how to get at one file by name, inside a folder  
inside the Documents folder, using the Fn IterateFolder.  I  can  
create an array of FSRef  of each file when iterating the folder, then  
lookup the file in that array and use the FSRef, but it is not direct  
access to the file such as when using a vref of a folder, and the  
filename to open in that folder.

Suggestions welcomed.

And thanks to everyone who has taken time to help me understand all of  

~ steve

On Jan 26, 2008, at 10:52 PM, Ken Shmidheiser wrote:

> In this thread, Brian wrote:
>> To figure it out, look closely at the parameters and the requirements
>> of the call. In this case CFURLCreateFromFSRef requires a pointer to
>> an FSRef in the second parm.  Next step: how do I pass a pointer to
>> CFURLCreateFromFSRef? Well, there is already have a pointer to an
>> FSRef in sRef, so that can be used. Next step: how do I tell FB to
>> pass a pointer?   In this case case using the "#" tells FB to leave
>> it alone and just pass as is since we already have a pointer to an
>> FSRef. Without the "#" FB tries to be helpful and pass an address of
>> the pointer (which is NOT what we want).
> Brian,
> This is the most succinct and easily understood explanation of # use  
> in FB I have ever seen.
> Keep 'em coming!
> Ken
> --