[comp.sys.apple2] Q: C & Prefixes

bkahn@archive.webo.dg.com (Bruce Kahn) (11/15/90)

  Im trying to port a C program to GS/OS w/minimal changes to the program.
I would however like to be able to the ability to access the GS/OS prefixes
from w/in my program (or just be able to track 2 separate 'paths' and switch
between them when using SFGetFile/SFPutFile).  For example, Id like to be
able to set a 'target' directory using one SFPutFile call and then allow
the user to select any 'source' files from any directory YET have the 
program remember the 'target' directory.  How can I do this in Orca/C?  Can
I 'reload' the info that SFPutFile would require between source and target
directory changes?  Does anyone have any sample C code to achieve this?

--
                                          Bruce (bkahn@archive.webo.dg.com or
                                                 kahn@adam.dg.com)
  
  Standard disclaimers apply, except where prohibited by law...

jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) (11/16/90)

Simple.  GS/OS provides you with 32 different prefixes.  Use them!!
Set some prefix of your choosing (except 1and 9, which are reserved) to
the target directory.  For instance, use the SetPrefix call to set
prefix 2 to point to the target directory.  Then, to refer to a file
there, refer to the file "2/filename."  GS/OS will resolve the prefix
automatically.  If you need to display the full name, you can use the
ExpandPath call or the GetPrefix call to find out what's in prefix 2.
--------------------
Jeffrey Hutzelman			America Online: JeffreyH11
Internet: jh4o+@andrew.cmu.edu		BITNET: JHUTZ@DRYCAS
>> Apple // Forever!!! <<