Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!apple.com!enwall From: enwall@apple.com (Tim Enwall) Newsgroups: comp.sys.mac.programmer Subject: Re: Pathname to wd ? Message-ID: <8572@goofy.Apple.COM> Date: 6 Jun 90 17:48:17 GMT References: <1234600036@uxa.cso.uiuc.edu> Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 26 In article <1234600036@uxa.cso.uiuc.edu> ews00461@uxa.cso.uiuc.edu writes: > How can I convert a full path name to a working directory refnum ? Eric, I don't know off-hand how to accomplish this. Pretty much there are only a few routines I know of which RETURN a wdRefNum. Most now return the real vRefNum. I will say this though: in general, I and most people here in DTS, stay as far away from wdRefNums as possible. True, StandardFile does return a wdRefNum (and there are others which do too), but I convert the wdRefNum to the real vRefNum/dirID pair with PBGetWDInfo. And then I don't have to worry about the wdRefNum. The whole Working Directory "thang" is there purely for compatibility with MFS directory structures, and is almost obsolete. You CAN get the vRefNum and the dirID with the full pathname (I think PBGetCatInfo will work, or one of those). Anyway, hope this helps. (BTW: MPW provides some routines like PBHOpenResFile which return vRefNum/dirID pairs rather than wdRefNums. Those can be very useful). Tim Enwall, Developer Technical Support neophyte.