Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!anaconda.cis.ohio-state.edu!topping From: topping@anaconda.cis.ohio-state.edu (brian e topping) Newsgroups: comp.sys.mac.programmer Subject: Re: Launching application returned in an SFReply record. Message-ID: <83084@tut.cis.ohio-state.edu> Date: 19 Aug 90 03:05:55 GMT References: <25810@cs.yale.edu> <9816@goofy.Apple.COM> Sender: news@tut.cis.ohio-state.edu Reply-To: brian e topping Distribution: usa Organization: Ohio State University Computer and Information Science Lines: 51 In article <9816@goofy.Apple.COM> nmday@apple.com (Neil) writes: > >-- Is there any function hidden in IM somplace that returns a full >-- path name given an SFReply? > >There is no toolbox routine to return a full path name, but doing it >yourself is fairly easy. >Here is a C routine to do it (gleaned from some DTS sample code)... Here is the same thing (I think) that I use short constructPath(cRecPtr,pathName,dirID) CInfoPBRec *cRecPtr; char *pathName; long dirID; { char buffer[32]; short error; if (dirID == 1) return(0); cRecPtr->dirInfo.ioDrDirID = dirID; cRecPtr->dirInfo.ioNamePtr = buffer; cRecPtr->dirInfo.ioFDirIndex = -1; if (error = PBGetCatInfo(cRecPtr,false)) return(error); if (error = constructPath(cRecPtr,pathName,cRecPtr->dirInfo.ioDrParID)) return(error); BlockMove(&(buffer[1]),&(pathName[pathName[0]+1]),buffer[0]); pathName[0] += buffer[0]; pathName[++pathName[0]] = ':'; return(0); } It basically stacks all the names as it follows up to the root, and copies on the way back down. Interesting, I thought (when I think). >Neil Day Brian Topping