Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!nosc!manta!lulue From: lulue@manta.NOSC.MIL (Dan Lulue ) Newsgroups: comp.sys.mac.programmer Subject: Saving data from one launch to another Message-ID: <975@manta.NOSC.MIL> Date: 13 Dec 89 00:08:35 GMT Organization: Computer Sciences Corporation Lines: 26 I need to save the location of a data file from one launch to another. The user points out the file's location via Std File, and my program "remembers" it for the next time. I am constrained to using UNIX sytle string pathnames. Is it preferable to save the string in a 'STR ' resource in application's resource fork, or in the data fork? I tried the resource fork by creating a 'STR ' resource, doing a GetString (which does a GetResource('STR ',ID), changing the string pointed to by the handle, calling ChangedResource, then WriteResource, etc. However, the new string never shows up in the resource fork (ResEdit view) after execution (the dummy string I placed there originally is still there). The 'STR ' resource was not purgable, but I called SetResPurge anyway, along with several other things suggested by Chernicoff to prevent the changed resource data from disappearing before being written. Chernicoff also suggests that the data fork is a good place to store this sort of data. Does opening the data fork of the running application mean doing an FSOpen on the application? If so, how does one get the vRefNum of the directory the application resides in? Any tips would really be appreciated. Thanks, Dan Lulue lulue@nosc.mil