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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!usenet
  3. From: Michael Babin
  4. Subject: Re: vrefNum from Path Name
  5. Message-ID: <1992Sep3.144223.4118@csc.ti.com>
  6. Sender: usenet@csc.ti.com
  7. Nntp-Posting-Host: 192.153.237.11
  8. Organization: Texas Instruments
  9. References: <47022@shamash.cdc.com> <Btwwt5.7Bv@taligent.com> <14960@borg.cs.unc.edu>
  10. Distribution: usa
  11. Date: Thu, 3 Sep 1992 14:42:23 GMT
  12. Lines: 28
  13.  
  14. In article <14960@borg.cs.unc.edu> lari@strauss.cs.unc.edu (Humayun Lari)
  15. writes:
  16. >In article <Btwwt5.7Bv@taligent.com> keith@taligent.com (Keith Rollin) writes:
  17. >>Remember, Inside Mac says that you should _NOT_ create FSSpecs by hand. You
  18. >>should always call FSMakeFSSpec. Don't go filling in the parID and vRefNum
  19. >>fields yourself. (There is one exception to this, which is that you can
  20. freely
  21. >>assign one FSSpec record to another.)
  22. >
  23. >What about when the file/directory you're referring to does not exist?
  24. >If I remember correctly, FSMakeFSSpec checks to make sure that it does, so
  25. >it would return an error code when you're trying to create an FSSpec prior to
  26. >performing a Save As... Or am I wrong about this? Keith?
  27. >
  28. >Humayun Lari
  29. >(lari@cs.unc.edu)
  30. >
  31.  
  32. You are correct.  FSMakeFSSpec returns an fnfErr (file not found, -43) in this
  33. case.  It also creates the FSSpec record for you.  Since you are performing a
  34. Save As..., check for this return value to warn the user about overwriting an
  35. existing file.  If they proceed with the overwrite, use the FSSpec in good
  36. health!
  37.  
  38. Mike Babin
  39. babin@lobby.ti.com
  40.  
  41.  
  42.