From: Morton Goldberg Date: 2006-08-21T04:24:52+09:00 Subject: Re: detect user I'm running on OS X, too. Here is what works for me in getting user environment info: user = ENV['USER'] # user login name home = ENV['HOME'] # user login path The second seems to be what you are looking for. Regards, Morton On Aug 20, 2006, at 2:41 PM, Ryan Kaye wrote: > Im new to ruby and trying to learn by building a small app for mac > osx. > So far I love it. However, one thing I want to do is to detect the > current user (of the app's) system directory name ie - > /Users/johnsmith/... - johnsmith being what I want get. > > One way I tried was to use a system call such as > > system("Users") > > but although this will output the current user in the console it will > not store the name as a variable because, as im sure you know, the > system call returns a boolean and not the result of the call. > > Anybody know of an alternative way.