Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!mcsun!cernvax!chx400!chx400!bernina!neptune!c!mneerach From: mneerach@iiic.ethz.ch (Matthias Ulrich Neeracher) Newsgroups: comp.sys.mac.programmer Subject: Re: Is AppFile.vRefNum always WDRefNum??? Message-ID: <24152@neptune.inf.ethz.ch> Date: 7 Feb 91 10:46:11 GMT References: <1991Feb4.190115.1@gsbacd.uchicago.edu> Sender: news@neptune.inf.ethz.ch Reply-To: mneerach@iiic.ethz.ch Organization: Departement Informatik, ETH, Zurich Lines: 24 In article <1991Feb4.190115.1@gsbacd.uchicago.edu>, gft_robert@gsbacd.uchicago.edu (opcode ranger) writes: |> I have a question regarding the vRefNum field in the AppFile data type: under |> HFS is this actually a WDRefNum? Is it guaranteed to be a WDRefNum? No. It is certainly not a WDRefNum for a file residing on a MFS volume, and I believe also that it's no WDRefNum for files on the 'root' level of a HFS volume. |> My problem is this: I need to get the dirID (parent dir id) for each file I get |> AppFile information for (i.e. for each file which is opened from the Finder |> with the application). If I know this field is a WDRefNum I can call |> PBGetWDInfo() on it and find the dirID. If it's not always a WDRefNum I'm not |> sure if this call will work. There is a Technote which describes a technique to determine whether a vRefNum is a WDRefNum: WDRefNums are given numbers -32768, -32767, -32766 or, if you prefer hex, $8000, $8001, $8002. Normal vRefNums have numbers 'close to zero'. Matthias -- Matthias Neeracher mneerach@iiic.ethz.ch "These days, though, you have to be pretty technical before you can even aspire to crudeness." -- William Gibson, _Johnny Mnemonic_