From: Charles Mills Date: 2005-04-03T14:34:43+09:00 Subject: Re: how do I find the name of the current user? Sam Roberts wrote: > Quoting csaba@phony_for_avoiding_spam.org, on Sun, Apr 03, 2005 at 11:54:43AM +0900: > > On 2005-04-03, Sam Roberts wrote: > > > I'm thinking Etc.getlogin followed by Etc.getpwnam.gecos might be best > > > on unix, is there a windowsy equivalent? > > > > Would this help you? > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/135205 > > It looks great, but I don't want to use it until its in the stdlib. Its > a little more than I want to get the name of the current user. > > But, I'll remember, I might need it in the future. > I don't know how portable this is, but: irb(main):001:0> ENV["USER"] => "cmills" -Charlie