Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!xxiaoye
From: xxiaoye@eleazar.dartmouth.edu (Xiaoxia Ye)
Newsgroups: comp.sys.mac.programmer
Subject: File Manager question
Message-ID: <15088@dartvax.Dartmouth.EDU>
Date: 18 Aug 89 01:29:48 GMT
Sender: news@dartvax.Dartmouth.EDU
Reply-To: xxiaoye@eleazar.dartmouth.edu (Xiaoxia Ye)
Organization: Dartmouth College, Hanover, NH
Lines: 41

I am fairly new to Mac Programming.  The other day I tackled the
dreaded IM IV File Manager section because I am writing an application
that need to save some preference parameters.  There are a number of
ways that I can think of solving this problem, but I can find a
solution or a safe solution to this:

1)  Saving the preferences in the data fork of the currently running
application.

Question:  How do I get the refNum, vRefNum of the currently running
application?  Here is a naive question: is the refNum for the resource
fork the same for the data fork ?  I can get the refNum from
CurResFile() from resource manager, but can I use it for FSWrite to the
data fork of the currently running application?  What about the vRefNum?
Can I simply pass '0' to stand for default working folder?  What happens
when the default working folder changes ?

2) Saving the preferences in a file in the currently blessed system
folder.

Question:  How do I get the vRefNum of the current system Folder ?

3) Saving the preference in a file in the same folder as the application
is in.

Question:  Similar question as in 1, how can I be sure that the default
working directory will not be changed ? is passing '0' as vRefNum always
safe?

Well, I have only read the High level routines in the File Manager
section of IM IV, should I read the low level routines too ?

Are these things discussed in any tech notes, which one ?

Much thanks in advance



________________________________________________________________________
Xiaoxia  Ye          INTERNET/BITNET/UUCP: xxiaoye@eleazar.dartmouth.edu
Dartmouth College    For more info: finger xxiaoye@eleazar.dartmouth.edu