Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!inebriae!crucible!al From: al@crucible.UUCP (Al Evans) Newsgroups: comp.sys.mac.programmer Subject: Re: Getting the full pathname? Summary: So I was wrong... Message-ID: <112@crucible.UUCP> Date: 16 Oct 89 14:34:30 GMT References: <850zebolskyd@yvax.byu.edu> <111@crucible.UUCP> <35671@apple.Apple.COM> Reply-To: al@crucible.UUCP (Al Evans) Followup-To: comp.sys.mac.programmer Organization: PowerTools, Austin, TX Lines: 31 In article <35671@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes: >In article <111@crucible.UUCP> al@crucible.UUCP (Al Evans) writes: >>In article <850zebolskyd@yvax.byu.edu> zebolskyd@yvax.byu.edu writes: >> >>>so on until to get to dirID=2, which will be the root. You get the names >> ^^^^^^^ >> Although this seems to be true, it doesn't seem to be documented :-( > >This *IS* documented. Check out the top of page 92 of Inside Mac IV. In add- >ition, this is the technique used in Technote #238 and DTS Sample Code #18: >Standard File. Finally, there is a constant defined in the MPW headers >(fsRtDirID) that identifies the root as 2. You're right on all counts. Shows how much Mac programming I've been doing recently. But STILL, I don't trust magic numbers, and prefer to find alternate solutions -- while I can imagine the dirID of the root directory changing, I suspect that trying to get information about its parent will ALWAYS return an error. >I'd probably base my exit condition on a specific error rather >than just any old error, but so far it looks pretty good. That's probably a good plan -- though if the routine fails for any reason OTHER than reaching the top of the directory tree, your application is in REALLY serious trouble. --Al Evans-- -- Al Evans "You'd grep to know what ...uunet!execu!sequoia!crucible!al you really sed." --Referent Blob