Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdahl!apple!darin From: darin@Apple.COM (Darin Adler) Newsgroups: comp.sys.mac.programmer Subject: Re: Full path name of a file Message-ID: <9460@apple.Apple.Com> Date: 10 May 88 02:16:53 GMT References: <2532@chalmers.UUCP> <301@piring.cwi.nl> <304@piring.cwi.nl> <6464@cit-vax.Caltech.Edu> Reply-To: darin@apple.UUCP (Darin Adler) Organization: Apple Lines: 29 In article <6464@cit-vax.Caltech.Edu> wetter@tybalt.caltech.edu.UUCP (Pierce T. Wetter) writes: > I'm assuming you have some special file your application needs to look at > which for some reason you don't want to save with your application in the > data fork. You want this file to be located somewhere other then the same > folder as the application or the system folder. > > Two ways to do this: If you can't find the file put up an sfgetfile box > and ask the user where it is. Then save the pathname in a str resource. If its > longer then 255 bytes, your application will just keep making the user find > it each time. > > Or, if the pathname is longer then 255 bytes, save it in pieces and wander > down the heiarchy each time you need to find the file. Developer Technical Support recommends this solution: Save the volume name, dirID of the directory containing the file, and file name. If the file is not where you expect it, use SFGetFile to have the user find it. This has a number of advantages. First of all, dirIDs are guaranteed to be unique for a volume. No dirID is ever reused. DirIDs also remain the same, even if one of the directories in the path down to the file is renamed. I can't really think of ANY good reason to calculate the full path name, except perhaps to display on the screen for some advanced users. -- Darin Adler AppleLink:Adler4 UUCP: {sun,voder,nsc,mtxinu,dual}!apple!darin CSNET: darin@Apple.com