Page 1 of 1

[MAC OS X] User Preference Folder

Posted: Thu Dec 22, 2005 8:26 pm
by SEO
On Mac OS X an 'FolderPointer' is needed to get the Users Preference Folder. This is used to store the Users 'Preference files'.

The structure is Users/myUserName/Library/Preferences
The problem is to get the 'UserName' ... So it is possible to build the 'path' String....

I think on OS X 10.4.x the folder names are the same, and not depending on the Language settings... (I don't remember how it was on 10.3.x)

On OS X there are also a lot of folders in the 'UserName' folder that store stuff for just that user...

So an 'Pointer' to the folder: UserName should fix a lot of problems.. Perhaps an Constant like this: #PB_UserDirectory so I could build an string like this:
FileName$ = #PB_UserDiectory + "Library/Preferences/myAppPrefs/myPrefsFile.txt"

I have tried to find an 'workaround' about this using ExamineDirectory and DirectoryEntryAttributes but Nope...

Regards,
SEO

Posted: Thu Dec 22, 2005 9:02 pm
by Fred
The next version of PB has a GetHomeDirectory() which will returns exactly what you want.

Posted: Thu Dec 22, 2005 9:04 pm
by netmaestro
What else has it got?

Posted: Thu Dec 22, 2005 9:05 pm
by Fred
Hum, a lot of stuff, it would take too much time to list them all.. Back to code :).

Posted: Thu Dec 22, 2005 9:05 pm
by SEO
THANKS!
/SEO