home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!ames!data.nas.nasa.gov!taligent!kip-28.taligent.com!user
- From: keith@taligent.com (Keith Rollin)
- Subject: Re: HELP! INIT and patching probs
- Message-ID: <keith-301292142544@kip-28.taligent.com>
- Followup-To: comp.sys.mac.programmer
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Organization: Taligent
- References: <C03AHq.9LF@news.cso.uiuc.edu>
- Date: Wed, 30 Dec 1992 22:33:54 GMT
- Lines: 36
-
- In article <C03AHq.9LF@news.cso.uiuc.edu>, cole@alexia.lis.uiuc.edu (Sandra
- Stewart-Cole) wrote:
- >
- > Is there any DOCUMENTED and SUPPORTED way to
- > get enough info about a file solely from the fact that it is the current
- > Resource file that I can then regain a path to it after I have been cut loose
- > from it WITHOUT relying on System 7 features? (i.e. get the info in the INIT,
- > and store it for later use from a global trap patch)
- >
-
- Execute this at INIT time:
-
- FSSpec me;
- OSErr err;
- FCBPBRec pb;
-
- pb.ioCompletion = nil;
- pb.ioNamePtr = me.name;
- pb.ioVRefNum = 0;
- pb.ioRefNum = CurResFile();
- pb.ioFCBIndx = 0;
-
- err = PBGetFCBInfoSync(&pb);
-
- me.vRefNum = pb.ioFCBVRefNum;
- me.parID = pb.ioFCBParID;
-
- I usually use THINK C, which makes the storage of the results in a global
- variable really simple. If you use MPW, then you can use the techniques
- shown in Technote #256 (OK, fine, so it has a new name, now) or "develop
- #12" to implement global variables. Or use a little assembly.
-
- -----
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-