Re: Best way of getting /Library/Preferences paths?
Re: Best way of getting /Library/Preferences paths?
- Subject: Re: Best way of getting /Library/Preferences paths?
- From: Andreas Mayer <email@hidden>
- Date: Sat, 18 Sep 2004 11:20:18 +0200
Am 18.09.2004 um 10:22 Uhr schrieb Christoffer Lerno:
Now I could simply hardcode these strings, but if there is some better
way of accessing these folders then I suppose that would be better.
- (NSString *)findSystemFolderType:(int)folderType forDomain:(int)domain
{
FSRef folder;
OSErr err = noErr;
CFURLRef url;
NSString *result = nil;
err = FSFindFolder(domain, folderType, false, &folder);
if (err == noErr) {
url = CFURLCreateFromFSRef(kCFAllocatorDefault, &folder);
result = [(NSURL *)url path];
}
return result;
}
Folder types are declared in Folders.h. In this case you would use
kPreferencesFolderType.
~/Library/Preferences would be in kUserDomain, /Library/Preferences in
kLocalDomain, I guess.
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden