[futurebasic] Re: [FB] Unclear on the wdrefnum concept

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2002 : Group Archive : Group : All Groups

From: "Steven J. Stratford" <sstrat@...>
Date: Thu, 27 Jun 2002 06:46:43 -0500
On 6/27/02 12:40 AM, "Alain Pastor" <pixmix@...> wrote:

> "Steven J. Stratford" wrote:
>> 
>> This function is off the release 6 CD, out of the file called Toolbox file
>> handling:
>> 
>> DIM AS INT ioErr
>> LOCAL FN NewFile (pb AS PTR, fNamePtr AS PTR TO STR31, Vol AS INT, Perm AS
>> INT)
>> 
>> ioErr = FN OpenFile(pb, fNamePtr, Vol, Perm)
>> 
>> LONG IF ioErr = _FnfErr
>> ioErr   = FN PBCreateSync(pb)
>> LONG IF ioErr = _noErr
>> ioErr = FN PBOpenSync(pb)
>> END IF
>> XELSE
>> LONG IF ioErr = _noErr
>> & pb +_ioMisc, 0
>> ioErr = FN PBSetEOFSync(pb)'Clear Out File
>> END IF
>> END IF
>> 
>> END FN = ioErr
>> 
>> Has it been upgraded for OS X? The reason I'm asking is because I use
>> earlier versions of those functions in that file in my CGIs, and I want to
>> start making them OS X compliant.
>> 
> Steve,
> 
> In the function above, you probably will have to replace PBCreateSync
> and PBOpenSync with PBHCreateSync and PBHOpenSync respectively. As a

Ah, now I know what I'm looking for--after some poking around in the include
files and the runtime, it appears that the toolbox routines I need are
already in "Subs Files.incl".

> side note, I would encourage you to start using the FSSpec structure
> since the working directory reference number is dead in Macdom.
> When you get such an entity from the FB FILES$ functions, it is a
> reference internally maintained by the runtime that has no meaning for
> the Toolbox. You can use this reference number as long as you use FB
> statements only. While it is astonishing to see that living dead still
> horny I would advocate for the riddance of that beast and particularly
> with the Appearance runtime. I see no point in keeping that thing from
> the past living artificially in that new runtime.
> If you want to call the Toolbox functions that deal with a parameter
> block anyway, you need to convert that fake reference to something
> useful. Whether before setting the fields of the parameter block (with
> the runtime built-in function FBFixDirAndVol(vol,dir) I think) or
> after setting the parameter block (with FBWDtoPBWD(parameterBlock)

So these two little conversion routines would only be used if one were to
want to use FB FILES$ functions _along with_ toolbox functions, did I read
that correctly?

Thanks, Alain.

--Steve

Steven J. Stratford, InterNetyx.com
http://www.internetyx.com
Web Site hosting services
CGI shareware for Mac/WebStar servers
Custom CGI programming