[futurebasic] Re: [FB] WD Confusion?

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

From: Alain Pastor <apastor@...>
Date: Tue, 28 Jan 2003 18:11:45 +0100

Robert Purves wrote:

> 
> 
> A small correction to Alain's otherwise excellent account of FSMakeFSSpec.
> Apple tells us not to use for the last parameter the FSSpec whose fields 
> are passed as the first three parameters.
> 
> "The file system specification structure that you pass in this parameter 
> should not share storage space with the input pathname; the name field 
> may be initialized to the empty string before the pathname has been 
> processed. For example, fileName should not refer to the name field of 
> the output file system specification."
> 
> You need a separate FSSpec to receive the output of FSMakeFSSpec.
> 
> 
> local fn doSomethingWithThatFile( f as .FSSpec )
> dim as FSSpec  myFSpec
> 
> select fn FSMakeFSSpec( f.vRefNum, f.parID, f.name, myFSpec )
> case _noErr  : // file OK, can be opened
> case _fnfErr : // missing file, maybe needs to be created
> case else    : // other error
> end select
> 
> // etc.
> 
> end fn
> 


Well, I didn't know about that one, so thank you Robert for that 
important info. I guess I have now some snippets of code to correct...


Alain