[Mono-osx] Get a user's home directory

Duane Wandless duane at wandless.net
Thu Mar 31 13:50:49 EDT 2011


Try:
Environment.GetFolderPath (Environment.SpecialFolder.Personal);
or
string homeOSFolder = Environment.GetEnvironmentVariable("HOME");


On Thu, Mar 31, 2011 at 12:09 PM, Florian Heiber <flo at rootof.net> wrote:

> Hi guys,
>
> I was wondering what's the proper way to get a user's home directory path?
> I was hoping I could do something like this in Objective-C:
>
> NSString *path = [@"~" stringByExpandingTildeInPath];
>
> There seems to be neither this method nor NSHomeDirectory(). So what's the
> right approach here?
>
> Thanks!
>
> Cheers
> –f
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110331/3f2f5391/attachment.html 


More information about the Mono-osx mailing list