home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14843 < prev    next >
Encoding:
Text File  |  1992-09-01  |  2.0 KB  |  46 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!taligent!keith@taligent.com
  3. From: keith@taligent.com (Keith Rollin)
  4. Subject: Re: vrefNum from Path Name
  5. Message-ID: <Btwwt5.7Bv@taligent.com>
  6. Sender: usenet@taligent.com (More Bytes Than You Can Read)
  7. Organization: Taligent
  8. References: <47022@shamash.cdc.com>
  9. Distribution: usa
  10. Date: Tue, 1 Sep 1992 18:31:53 GMT
  11. Lines: 33
  12.  
  13. In article <47022@shamash.cdc.com>, paul@svl.cdc.com (Paul Kohlmiller) writes:
  14. > This may be a FAQ but I didn't find it.
  15. > Most Mac apps have a dialog box to find a file such as the one you
  16. > get with SFGetFile etc.
  17. > When you do this you get the vrefNum but not the parID which is
  18. > another problem for later.
  19. > However, I have an application that wants to get the file from a
  20. > pathname and there is no place for a vrefNum. While this seems
  21. > unMaclike, it seems to work for MPW which can take a path name in
  22. > a Link command. Maybe simply opening a file can be done with just
  23. > a path but LaunchApplication needs a FSSpec which needs the
  24. > vrefNum and the parID. The parID I can set to 0 for now (do I care
  25. > about parID on non-A/UX apps) but the vrefNum I need. The best
  26. > solution I have so far is to do the dialog box once and keep the
  27. > vrefNum info. What I would like is a function that returns vrefNum
  28. > from a file pathname but I don't see it. Any ideas?
  29.  
  30. Page 25-16 of Inside Mac VI shows that FSMakeFSSpec can take a full pathname.
  31. When you feed it a full pathname, the vRefNum and parID you pass it are ignored.
  32. The vRefNum and parID fields of the FSSpec record it returns will be filled out
  33. properly from the information in the full pathname.
  34.  
  35. Remember, Inside Mac says that you should _NOT_ create FSSpecs by hand. You
  36. should always call FSMakeFSSpec. Don't go filling in the parID and vRefNum
  37. fields yourself. (There is one exception to this, which is that you can freely
  38. assign one FSSpec record to another.)
  39.  
  40. --
  41. Keith Rollin
  42. Phantom Programmer
  43. Taligent, Inc.
  44.  
  45.