Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!well!wdh From: wdh@well.UUCP (Bill Hofmann) Newsgroups: comp.sys.mac.programmer Subject: Re: Clarification of question 2 Keywords: clarification, FileManager, get file name Message-ID: <12157@well.UUCP> Date: 12 Jun 89 20:34:20 GMT References: <8326@killer.DALLAS.TX.US> Reply-To: wdh@well.UUCP (Bill Hofmann) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 24 What I've done to deal with THINK C projects vs built applications is this: GetAppParms(apName,&apRefNum,&signature); if (signature = GetResource(ApplCreator,0)) { /* this way we can use Lightspeed C */ apRefNum = fb.ioRefNum = HomeResFile(signature); ReleaseResource(signature); } else fb.ioRefNum = apRefNum; This way, if we want to add data to either fork of the current app if it's built or to the rsrc file if it's running with a project, we're covered. Here, I assume that there is a signature resource defined by ApplCreator. If we're running from the project, it's in the .rsrc file, and if we're running in a built app, it's in the app. If it isn't there, we have the apRefNum anyway, so we're covered (in the case of running from the project, we'll write into the project file, not such a good idea, but if you do this early on in the app, you ought to have enough memory, and as long as you remember to put the signature resource in there, you'll be ok). Yes, I know this is not the way to add preferences. This is how one might personalize an application. BTW, fb is a param block later passed to PBGetFCBInfo. -Bill Hofmann