[futurebasic] Re: [FB] FSSpecs vs FSRefs

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

From: Brian Stevens <bstevens33@...>
Date: Sat, 26 Jan 2008 13:02:55 -0700
On Jan 26, 2008, at 3:01 AM, andy@... wrote:

> Hi Brian / Robert,
> I am finding it hard to track down the documentation on FSRefs
Tons. The FileManager section of XCode docs or Apple Developer web  
site. What is it specifically you need to know?

> . Is any written?
Do you mean FBtoC documentation? There is one example in FBtoC's  

FBtoC documents any differences from FB. Other than that it uses  
FSRefs the same way Apple defines them. There is nothing extra added  
or removed.

> I know about VolRefs (and FSSpec) but they are both deprecated and  
> I would
> like to take your advice and jump straight to FSRef
For the most part, FSRefs are used just like FSSpecs but you have to  
pick the right call to make when using an FSRef.

> Locate application volume
> Goto Sub folder
> Let user select folder
> Open file for Read
> Read file
> Open file for Write
> Write file

Read file, Write file are not concerned with how the file was opened  
(i.e. with a FSSpec or a FSRef) so their syntax for use with FSRefs  
does not change. All they do is read or write. The choice of FSRef  
vs. FSSpec comes when the file is OPENed (see the Language  
Enhancement section of FBtoC help). Open file for read or write is  
also documented in the Language Enhancement section of FBtoC docs.

"Let user select folder". This is just a matter of picking the FSRef  
version of a call when call Navigation Services. If you are asking  
about the corresponding FSRef support in files$ for _FSSpecFolder, it  
doesn't exist yet (AFAIK). Somebody will have to write it or you will  
have to cal Nav Services directly (which is what files$ does)

Brian S.