home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 14239 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.3 KB  |  41 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!data.nas.nasa.gov!taligent!keith@taligent.com
  3. From: keith@taligent.com (Keith Rollin)
  4. Subject: Re: converting the vRefNum and DirID to just a vRefNum...
  5. Message-ID: <Bt99nn.EGz@taligent.com>
  6. Sender: usenet@taligent.com (More Bytes Than You Can Read)
  7. Organization: Taligent
  8. References: <1992Aug19.182018.29206@nntp.uoregon.edu>
  9. Distribution: usa
  10. Date: Thu, 20 Aug 1992 00:06:59 GMT
  11. Lines: 28
  12.  
  13. In article <1992Aug19.182018.29206@nntp.uoregon.edu>,
  14. eric_gorr@coglab_psych.uoregon.edu (Eric Gorr) writes:
  15. > I have a vRefNum and a DirID and I want to use these two numbers so that I
  16. > can have just a vRefNum to be used by SetVol.  
  17. > How can I do this?
  18.  
  19. Don't.
  20.  
  21. Calling SetVol is generally a bad idea. It would be better if you just kept
  22. track of the vRefNum and dirID, and passed them to routines like HOpen,
  23. HOpenResFile, FSpOpenDF, and FSpOpenResFile.
  24.  
  25. Probably the only reason for setting the default directory is if you are going
  26. to call some lamoid C routines like fopen(). In that case, it would be better to
  27. call HSetVol in the following sequence (syntax approximate):
  28.  
  29.     GetVol(&oldVol);
  30.     HSetVol(newVRefNum, newDirID);
  31.     myFile = fopen(myFileName, "r");
  32.     SetVol(oldVol);
  33.  
  34. --
  35. Keith Rollin
  36. Phantom Programmer
  37. Taligent, Inc.
  38.  
  39.