Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!att!cbnewsk!ech From: ech@cbnewsk.att.com (ned.horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: refNum from WD DirID? Message-ID: <1991May16.140313.23618@cbnewsk.att.com> Date: 16 May 91 14:03:13 GMT References: <1991May15.160944.19184@linus.mitre.org> Organization: AT&T Bell Laboratories Lines: 20 From article <1991May15.160944.19184@linus.mitre.org>, by laf@mitre.org (Lee Fyock): > In article <1991May15.125921.15058@linus.mitre.org> laf@mitre.org (Me) writes: >>Does anyone have an easy way to get a refNum for a directory from >>its WD Dir ID? Or even a not-so-easy way? > > Let me explain further: > > I have a working directory dir ID and a refNum for an open file. I'm > trying to find out if the given file is in the given directory. I've tried > various incantations of PBGetWDInfo, but haven't found anything that will > give me a way to find the directory of the open file. AH, now I can help you (I tried already, but my mail bounced). You want to pass the file refNum to PBGetFCBInfo (IM IV-179). It returns the infamous triple -- vRefNum, dirID, and filename -- that you need to uniquely identify the file. -- =Ned Horvath= ehorvath@attmail.com