home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!data.nas.nasa.gov!taligent!keith@taligent.com
- From: keith@taligent.com (Keith Rollin)
- Subject: Re: converting the vRefNum and DirID to just a vRefNum...
- Message-ID: <Bt99nn.EGz@taligent.com>
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Organization: Taligent
- References: <1992Aug19.182018.29206@nntp.uoregon.edu>
- Distribution: usa
- Date: Thu, 20 Aug 1992 00:06:59 GMT
- Lines: 28
-
- In article <1992Aug19.182018.29206@nntp.uoregon.edu>,
- eric_gorr@coglab_psych.uoregon.edu (Eric Gorr) writes:
- >
- > I have a vRefNum and a DirID and I want to use these two numbers so that I
- > can have just a vRefNum to be used by SetVol.
- >
- > How can I do this?
-
- Don't.
-
- Calling SetVol is generally a bad idea. It would be better if you just kept
- track of the vRefNum and dirID, and passed them to routines like HOpen,
- HOpenResFile, FSpOpenDF, and FSpOpenResFile.
-
- Probably the only reason for setting the default directory is if you are going
- to call some lamoid C routines like fopen(). In that case, it would be better to
- call HSetVol in the following sequence (syntax approximate):
-
- GetVol(&oldVol);
- HSetVol(newVRefNum, newDirID);
- myFile = fopen(myFileName, "r");
- SetVol(oldVol);
-
- --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
-