faqts : Computers : Programming : Application Frameworks : Macintosh : Cocoa

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 11 people (27%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How can I get the path to the user's home directory? Application Support directory? Library directory?

Apr 29th, 2002 19:51
Christopher Holland,


There are a number of cool things that you can get using the path utilities. Try using the following functions:
NSFullUserName() - Returns a string containing the full name of the current user.
NSHomeDirectory() - Returns a path to the current user's home directory.
NSHomeDirectoryForUser(NSString *userName) - Returns a path to the home directory for the user specified by userName.
etc, etc.... check out Apple's documentation for more insights.