From: Joey Date: 2006-08-21T03:48:28+09:00 Subject: Re: detect user ------=_Part_44546_29148948.1156099707322 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline You can use ``, like: users = `Users`.chomp OR user = `whoami`.chomp j`ey http://www.eachmapinject.com On 8/20/06, Ryan Kaye wrote: > > Hi > > 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. > > Cheers > > R > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_44546_29148948.1156099707322--