Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6598

Re: getting the user's home directory path

From OscarRyz <oscarryz@gmail.com>
Newsgroups comp.lang.ruby
Subject Re: getting the user's home directory path
Date 2012-08-10 18:00 -0700
Organization http://groups.google.com
Message-ID <6ef0a06e-b847-4b9d-9148-70b5f822dfac@googlegroups.com> (permalink)
References <20080320070520.GA11412@demeter.hydra> <20080320211559.7282BE080A@mail.bc9.jp> <20080321232232.GF67561@demeter.hydra>

Show all headers | View raw


On Friday, March 21, 2008 5:22:30 PM UTC-6, Chad Perrin wrote:
> On Fri, Mar 21, 2008 at 06:16:02AM +0900, Nobuyoshi Nakada wrote:
> > Hi,
> > 
> > At Thu, 20 Mar 2008 16:05:12 +0900,
> > Chad Perrin wrote in [ruby-talk:295141]:
> > > I've got a program that needs to access a file in the ~/etc/ directory.
> > > This program currently accesses it like so:
> > > 
> > >   file_path = File.expand_path("~#{ENV['USER']}/etc/#{filename}")
> > 
> > File.expand_path("~/etc/#{filename}")
> 
> Amazing -- and confusing.  I could swear I actually tried that and it
> didn't work out for me.  I guess I must have dreamed that.
> 
> -- 
> CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
> Phillip J. Haack: "Productivity is not about speed. It's about velocity.
> You can be fast, but if you're going in the wrong direction, you're not
> helping anyone."



On Friday, March 21, 2008 5:22:30 PM UTC-6, Chad Perrin wrote:
> On Fri, Mar 21, 2008 at 06:16:02AM +0900, Nobuyoshi Nakada wrote:
> > Hi,
> > 
> > At Thu, 20 Mar 2008 16:05:12 +0900,
> > Chad Perrin wrote in [ruby-talk:295141]:
> > > I've got a program that needs to access a file in the ~/etc/ directory.
> > > This program currently accesses it like so:
> > > 
> > >   file_path = File.expand_path("~#{ENV['USER']}/etc/#{filename}")
> > 
> > File.expand_path("~/etc/#{filename}")
> 
> Amazing -- and confusing.  I could swear I actually tried that and it
> didn't work out for me.  I guess I must have dreamed that.
> 
> -- 
> CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
> Phillip J. Haack: "Productivity is not about speed. It's about velocity.
> You can be fast, but if you're going in the wrong direction, you're not
> helping anyone."

Back to comp.lang.ruby | Previous | Next | Find similar


Thread

Re: getting the user's home directory path OscarRyz <oscarryz@gmail.com> - 2012-08-10 18:00 -0700

csiph-web