From: Jeffrey Smith Date: 2011-09-04T07:27:06+09:00 Subject: Re: opening a file with variable name Hello Hassan, Thanks for the quick response. When I do a puts "path", this is what I get: \\faxgw04\c$\myapp\jobs\Processed\7.7.7\App Fax Service\sd3n4v1.20110902.1024.55435838.JMym.txt". This is the path to the file I want to open. Jeff On Sep 3, 2011, at 6:16 PM, Hassan Schroeder wrote: > On Sat, Sep 3, 2011 at 2:59 PM, Jeffrey Smith wrote: > >> I have tried File.open(variable), but I always get an error message stating "Invaild argument - path to file (Errno::EINVAL). > > ruby-1.9.2-p290 > variable = "foo.txt" > => "foo.txt" > ruby-1.9.2-p290 > File.open(variable) > => # > ruby-1.9.2-p290 > > > In the above case I know there's a file with that name in the same > directory where I started irb. > > Maybe you should look at what your variable actually contains... > > -- > Hassan Schroeder ------------------------ hassan.schroeder@gmail.com > http://about.me/hassanschroeder > twitter: @hassan >