From: Adriano Ferreira Date: 2005-03-03T21:56:08+09:00 Subject: Re: Env class bug? > irb(main):002:0> Etc.getlogin > => "root" > Is this expected behaviour? Seems like a bug to me. Am I missing something? Etc.getlogin likely "implements the C library function of the same name, which on most systems returns the current login from /etc/utmp, if any". With a 'su' you changed the real user user id and getlogin() returns the name associated with the current login activity. So as Guy Decoux said it is the expected behaviour and Etc.getpwuid(Process::Sys.geteuid)[:dir] is what you want.