Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!think!ames!lll-lcc!pyramid!voder!apple!darin From: darin@apple.UUCP (Darin Adler) Newsgroups: comp.sys.mac Subject: Re: SFGetFile question Message-ID: <7068@apple.UUCP> Date: 19 Dec 87 02:31:34 GMT References: <508@vub.UUCP> <3600016@iuvax> <8119@prls.UUCP> Reply-To: darin@apple.UUCP (Darin Adler) Organization: Apple Lines: 26 In article <8119@prls.UUCP> gardner@prls.UUCP (Robert Gardner) writes: > I am trying to call SFPGetFile twice in a row to get two input > files from the user. On the second call I want to filter out > the file they chose the first time. I have not been able to find > a way to do this. If anyone has any ideas I would appreciate > help ASAP. > > My first attempt was to save the file name and vRefNum from the > first call and then check those fields in the fileParam block passed > to the filter for a match. Unfortunately, the ioVRefNum passed to > the filter is ALWAYS -1 (at least under HFS). I can't figure out > any way to get from the information in the fileParam block to > a vRefNum to compare it with. You are on the right track. The problem that you have here is that both PBGetCatInfo (which is called automatically by Standard File) and PBGetFInfo return both a vRefNum and a dirID. The reason that the ioVRefNum is always -1, is that the vRefNum of the disk in question IS -1. The vRefNum that you get from Standard File in the reply is a WDRefNum. To find out the dirID for this WDRefNum you can call PBGetWDInfo. Then, you can compare the file name, the vRefNum *and* the dirID. -- Darin Adler, Apple Computer AppleLink:Adler4 UUCP: {sun,voder,nsc,mtxinu,dual}!apple!darin CSNET: darin@Apple.com