Angus Leeming <[EMAIL PROTECTED]> writes:

> 
> Andreas, Bennett, Jean-Marc, 
> 
> I wonder if you can help me out. I'm trying to write the function below. It
> is meant to return a string that contains the absolute path to a
> directory. Note that this directory need not yet exist.
> 
> string const get_default_user_lyxdir(string const & homedir)
...
> I have two questions for Mac OSX.
> 1. What should a typical returned value be?

/Users/NAME/.lyx (POSIX std)
or
/Users/NAME/Library/Preferences/LyX (this place is mainly used by *.plist files)
or
/Users/NAME/Library/Application Support/LyX (eg. FireFox stores its profiles 
near this place)

I would guess. 

> 2. What's the code I need to return such a value?
> 
> Jean-Marc has suggested that I use FSFindFolder, but this fills an FSRef
> variable with some opaque data usable only by the File Manager, not by me,
> the user. See the FSFindFolder docs at http://tinyurl.com/5mvgn.
> Nonetheless, a naÃve implementation (mine) would be
> 
>         FSRef fsref;
>         OSErr const error_code =
>                 FSFindFolder(kUserDomain,
>                              kPreferencesFolderType,
>                              kDontCreateFolder,
>                              &fsref);
> 
> Is it possible to take this filled fsref variable and extract the absolute
> path to the folder in question? What system function would I need to do
> this?

>From the FileManager docs I would guess FSRefMakePath. It sais it produces 
POSIX paths.

> 
> Alternatively, it seems that I might use GetFolderName. (See the Functions

As I understood this function yields the user interface name for this folder. 
Eg.
"Programme" instead of "/Applications". Don't use it.

> 
> Further, have I got the correct values with "kUserDomain" and
> "kPreferencesFolderType"?

Looks ok from the docs.

> 
> Basically, I'm looking for someone with access to a Mac to write the code
> for me 

Do you have a patch against 1.4cvs? :-)


/Andreas

Reply via email to