[futurebasic] Re: [FB] FSpGetCatInfo

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

From: Pete Beaumont <furbies@...>
Date: Sun, 19 May 2002 14:28:23 +1000
On Sunday, May 19, 2002, at 12:47  AM, Alain Pastor wrote:

> Pete Beaumont wrote:
>>
>> Does anyone have an example of how to use FSpGetCatInfo.
>>
>> tia
>>
> As far as I know FSpGetCatInfo is not a Toolbox function, I believe
> you need to create it, perhaps something like this:
>
> INCLUDE "Tlbx Files.Incl"
>
> LOCAL FN FSpGetCatInfo( fSpec AS .FSSpec, pb AS .CInfoPBRec)
>   DEF BLOCKFILL( pb, SIZEOF(CInfoPBRec), 0 )
>   pb.ioVRefNum%   = fSpec.vRefNum
>   pb.ioDirID&     = fSpec.parID
>   pb.ioNamePtr&   = @fSpec.name
>   pb.ioFDirIndex% = 0
> END FN = FN PBGetCatInfoSync( pb )
>

Thanks Alain.
I'll see if I ca get the code to work in my project.

Why do you have a period in the var type declarations:
( fSpec AS .FSSpec, pb AS .CInfoPBRec)

Thanks again...

Pete...

>
> WINDOW 1
> gFBUseNavServices = _zTrue
>
> DIM f  AS FSSpec
> DIM pb AS CInfoPBRec
>
> LONG IF LEN( FILES$( _FSSpecOpen, "", "", f ) )
>   LONG IF FN FSpGetCatInfo( f, pb ) = _noErr
>     PRINT PSTR$( pb.ioNamePtr& )
>     PRINT MKI$( pb.ioFlFndrInfo.fdType& ),MKI$(
> pb.ioFlFndrInfo.fdCreator& )
>   END IF
> END IF
>
> DO
>   HANDLEEVENTS
> UNTIL _nil
>
> Notice that if you want to use a generic pointer instead of
> CInfoPBRecPtr you may have troubles with FB predefined constants.
>
> --
> Cheers,
>
> Alain
> ------------------------------------------------------
>                  Program different
>
>                       E = FB^3
>
> FutureBASIC^3 in Europe:  http://euro.futurebasic.com/
> ------------------------------------------------------
>
> --
> To unsubscribe, send ANY message to <futurebasic-
> unsubscribe@...>
>
>