From: Eero Saynatkari Date: 2009-01-22T01:25:05+09:00 Subject: [ruby-core:21490] Re: [Feature #1027] Dir.home Excerpts from Nobuyoshi Nakada's message of Wed Jan 21 05:19:23 +0200 2009: > Hi, > > At Tue, 20 Jan 2009 18:00:00 +0900, > Kazuhiro NISHIYAMA wrote in [ruby-core:21454]: > > Portable way of getting home directory is complex see [ruby-core:12347]. > > I think a simplest getting home directory is > > Dir.chdir { Dir.pwd } > > now. > > But this is not thread-safe and changes directory needlessness. > > File.expand_path("~") works. A Dir.home might be more idiomatic considering Windows et al. (And, of course, `File.expand_path ""` does not expand to the home directory in 1.8.6 at least, which may or may not be expected.) -- Magic is insufficiently advanced technology.