[info-mcl] User's Home Directory

Terje Norderhaug terje at in-progress.com
Fri Jul 24 11:32:00 CDT 2009


On Jul 24, 2009, at 7:25 AM, Glen Foy wrote:
> How can you get the user's home directory in 5.2?
>
> (user-homedir-pathname) returns the user's home directory in CCL, but
> in MCL it returns the MCL folder.  This is not a error.  The HyperSpec
> says the value returned is implementation dependent.
>
> In RMCL I can use Brendan Burns'  bsd.lisp, which cleverly lets you
> run shell commands.  But that code needs some updating for 5.2.
>
> Is there another way of doing this?

(ccl::findfolder #$kOnAppropriateDisk #$kCurrentUserFolderType)  ;;  
calls #_FSFindFolder

You can use a number of constants with this function to locate  
various useful directories:

http://developer.apple.com/documentation/Carbon/Reference/ 
Folder_Manager/Reference/reference.html#//apple_ref/c/tdef/FolderType

-- Terje Norderhaug



More information about the info-mcl mailing list