[futurebasic] Re: [FB] how to get type and creator?

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

From: Steve <mactech@...>
Date: Tue, 22 May 2007 08:08:03 -0400
HI RP,

What is the best way to set the creator type for a file without  
creating a resource file?

Steve

On May 22, 2007, at 8:02 AM, Robert Purves wrote:

>
> luciano bernardi wrote:
>
>> could you please let me know
>> how is it possible to obtain the type and creator from one file?
>
>
> local mode
> local fn FSpGetTypeAndCreator( f as ^FSSpec, @type as ^OSType,  
> @creat as ^OSType )
> '~'1
> dim as FInfo myFileInfo
> dim as OSErr err
>
> type.0& = 0
> creat.0& = 0
> if ( f == 0 ) then err = _paramErr : exit fn
> err = fn FSpGetFInfo( #f, @myFileInfo )
> if ( err ) then exit fn
> type.0& = myFileInfo.fdType
> creat.0& = myFileInfo.fdCreator
> end fn = err
>
>
> dim as OSType @ type, creat
> dim as FSSpec f
> f.name = "FB_Temp"
> f.vRefNum = 0
> f.parID = 0
> fn FSpGetTypeAndCreator( f, @type, @creat )
> print mki$( type ), mki$( creat )
> stop
>
>
> Robert P.
>
> --
> To unsubscribe, send ANY message to: futurebasic- 
> unsubscribe@...
>