On 11/21/04 3:42 AM, OL&L Lists didst favor us with:
> I think Laurence suggested this. FSFindFolder does seem to be the
> best solution, but I don't see any routine to convert from FSRef to
> full POSIX path, only one to go the other way.
>From Files.h:
* FSRefMakePath()
*
* Summary:
* converts an FSRef to a POSIX path
Read those headers.
Larry
> My problem was not
> getting the $HOME dir itself but rather, a reference to a file in
> $HOME - using $HOME as a component of the full path. The code I ended
> up using that works is:
>
> OSErr GetHomeFileRef( FSRef *outRef )
> {
> FSRef userFolderRef;
> UniChar fileName[] = kUnicodeName;
> OSStatus fileErr = noErr;
>
> fileErr = FSFindFolder( kUserDomain, kCurrentUserFolderType,
> kCreateFolder, &userFolderRef );
> if( fileErr == noErr )
> {
> // Make new ref for the backup file...
>
> fileErr = FSMakeFSRefUnicode( &userFolderRef,
> kNameLength,
> fileName,
> kTextEncodingDefaultFormat,
> outRef
> );
> }
>
> Michael
> Orbital Launch & Lift, Inc.
> http://www.orbitallaunch.com
>
> At 3:42 PM +0100 11/16/04, <email@hidden> wrote:
>> Hi all,
>>
>> Can you re-post the thread "Getting the current user dir in Carbon".
>>
>> I just signed in, and this thread seems to be discussing my problem:
>> I am trying te get the path to the home directory of the current user on
>> Tiger.
>>
>> With folder manager's FSFindFolder, but I couldn't get it right, also on
>> Panther.
>>
>> I expected to use the constant kCurrentUserFolderLocation as i did with
>> kDesktopFolderType but FSFindFolder return an error (-43 on Tiger)
>>
>> thanks for help.
>>
>> jacques
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden