Re: Preference file reading by using FindFolder()
Re: Preference file reading by using FindFolder()
- Subject: Re: Preference file reading by using FindFolder()
- From: Daniel Jalkut <email@hidden>
- Date: Tue, 7 Jun 2005 10:07:23 -0400
Anna - on Mac OS X there is more than one location for preference
files. The user's preference files are never stored in /System. They
are usually stored in the user's home directory (e.g.
/Users/anna/Library/Preferences) but may also be stored in /Library if
they apply to all users on a given system. The reason you're not
seeing a /System/Library/Preferences folder is because that folder
would be unwritable by every user except root.
In general, the best thing to do when porting FindFolder preferences
code from OS 9 to OS X is to continue asking for the
kPreferencesFolderType selector, but change the volume parameter to
"kUserDomain." This will give you the Preferences folder in the user's
home directory.
Daniel
On Jun 2, 2005, at 7:40 AM, anna Smith wrote:
Hi friends,
i need help for reading preference file.
I am porting project from mac OS 9 to Mac X , And my old preference
file is in System/preference /preffile
in the preference folder and i want to read that preference file i am
using FindFolder function but i am not able to open that preference
file.
I have query in Mac OS 9 we had System folder and that have
Preference folder where as in the mac OS X we have System folder which
is having sub folder Library and that is having preferencePane folder.
i am confuse whether Find Folder auto matically find this folder file
or i need to do something else
Please let me know if anyone can halp me out
sample code
err = noErr; vref = 0; dir = 0L;
resnum=CurResFile();
result = TRUE;
memset(dbcnP,0,sizeof(PinkDbCnTyp));
err =
FindFolder(kOnSystemDisk,kPreferencesFolderType,kCreateFolder,&vref,&di
r);
err = HOpenResFile ( vref,dir,
(ConstStr255Param)dbSettingFileName, fsRdPerm );
if(err == -1)
result = err;
else
{
}
Thanks
Anna
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden