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