home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20953 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.8 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!news.udel.edu!chopin.udel.edu!kurisuto
  2. From: kurisuto@chopin.udel.edu (Sean J. Crist)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Questions about referring to files
  5. Message-ID: <C0IIvs.8L2@news.udel.edu>
  6. Date: 8 Jan 93 01:59:51 GMT
  7. Sender: usenet@news.udel.edu
  8. Organization: University of Delaware
  9. Lines: 42
  10. Nntp-Posting-Host: chopin.udel.edu
  11.  
  12. Here's what I want to do:  My application saves all of its data in
  13. resource files.  I want the user to be able to save and open these files
  14. using SFGetFile and SFPutFile, as usual.  Also, I need to be able to open
  15. temporary files in the System Folder when the user chooses 'New'; if the
  16. user doesn't save this document, the temporary file will be deleted, but if
  17. the user does save it, it will be copied into the appropriate directory.
  18.  
  19. My problem is this:  I've read the file manager chapters in IM I, IV, and
  20. VI thoroughly, and I'm in the dark about which paradigm I should use to refer
  21. to my files.  I want to support System 6.0.4 and higher; if I am not
  22. mistaken, this means I can't use the FSSpec designation from System 7.  I
  23. would have thought that a filename and vRefNum would be good enough, but I
  24. recently saw a posting here on c.s.m.p. which I understood to say that
  25. this way of designating files went out of fashion with System 3.2.
  26. (I'm currently using OpenRFPerm to open my resource files, which seems to
  27. be working fairly well.)
  28.  
  29. Second question:  System 6.x and System 7.x organize the System
  30. Folder differently (well, System 6.x doesn't organize it at all :-).  Is
  31. the correct way to handle temporary files to use Gestalt to see whether
  32. the Temporary Items folder of System 7.x is available, and to store into
  33. the main System Folder if not?  If anyone has or knows of some source code
  34. in Pascal which stores temporary files in both System 6 and 7, I would
  35. greatly appreciate seeing it.  (I'm not sure exactly how to locate the
  36. System Folder or Temporary Items folder in either case.)
  37.  
  38. I'm also not certain how to move my temporary file out of the appropriate
  39. directory into the one chosen by the user with SFPutFile.  If it's on
  40. another volume I'll obviously have to copy it myself.  I believe System 7
  41. has some way of easily moving files within one volume, but does System 6?
  42. (If it's something too complicated, I'll just make a copy of the file and then
  43. delete the original, briefly wasting a small amount of disk space.)
  44.  
  45. One last thing:  my application doesn't support Apple Events yet, but I
  46. plan to add such support.  Does this constrain me to using a particular
  47. file designation scheme, or can I just convert between FSSpec and an older
  48. scheme as I need?  (Also, is there sample code anywhere illustrating how
  49. to handle the core Apple events?)
  50.  
  51. Thank you very much.  If there is interest I will summarize and post.
  52.  
  53. --Kurisuto
  54.