[futurebasic] Re: [FB] Re: [FB} Creator and File Type

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

From: Brian Stevens <bstevens33@...>
Date: Mon, 19 Nov 2007 08:31:19 -0700
On Nov 18, 2007, at 11:01 PM, David Bailey wrote:

> There is an example on the CD called
> SetTypeAndCreator.bas
> Should be exactly what you need
> David

This will work, but it uses old deprecated methods.  I would suggest  
more modern code (posted several times in the past) using  
FSGetCatalogInfo and FSSetCatalogInfo.

The overview of the process is:
1) Get an FSRef (or FSSpec) to the file - presumably using the FB  
files$ command

2) Do the FSGetCatalogInfo with the second parm of  
_kFSCatInfoFinderInfo to retrieve the finder info for the file

3) Stash the type and creator (as OSTypes) into the the FSCatalogInfo  
structure returned by the FSGetCatalogInfo call

4) call FSSetCatalogInfo

Brian S.