User home


#1

Is there any method to get the value of user home which in Linux would
be stored in $HOME?

Valid for windows and mac osx too


#2

On Tue, Oct 14, 2008 at 6:19 PM, Kless removed_email_address@domain.invalid wrote:

Is there any method to get the value of user home which in Linux would
be stored in $HOME?

ENV[‘HOME’]

Valid for windows and mac osx too

Not sure…

Jesus.


#3

On 14 oct, 17:31, Jesús Gabriel y Galán removed_email_address@domain.invalid
wrote:

On Tue, Oct 14, 2008 at 6:19 PM, Kless removed_email_address@domain.invalid wrote:

Is there any method to get the value of user home which in Linux would
be stored in $HOME?

ENV[‘HOME’]

Valid for windows and mac osx too

Not sure…
After of questioning on IRC:

It’s valid too on OSX.

In Windows it’s not always set, usually only if your system is on a
domain. But can be used ENV[‘USERPROFILE’] if ENV[‘HOME’] isn’t set
and you’ll be okay most of the time.


#4

On Tue, Oct 14, 2008 at 6:31 PM, Jesús Gabriel y Galán
removed_email_address@domain.invalid wrote:

On Tue, Oct 14, 2008 at 6:19 PM, Kless removed_email_address@domain.invalid wrote:

Is there any method to get the value of user home which in Linux would
be stored in $HOME?

ENV[‘HOME’]

Valid for windows and mac osx too

Works fine in OS X.

Rails has a Dir.user_home which is more complicated. No idea if that
works on Windows, but the source is here:
http://noobkit.com/show/ruby/rails/rails-stable/rails/dir/user_home.html