From: Jeffrey Smith Date: 2011-09-04T09:35:56+09:00 Subject: Re: opening a file with variable name On Sep 3, 2011, at 7:39 PM, Hassan Schroeder wrote: > On Sat, Sep 3, 2011 at 4:26 PM, Jeffrey Smith wrote: >> I changed the slashed and escaped the file path ( I noticed after the fact that my path has spaces), and no change in the error at all. > >>> Again, what OS? << > > Have you tried 1) opening a file that's in the same directory you've > started IRB in? 2) changing directories to the one with the target file > and starting IRB there? > > -- > Hassan Schroeder ------------------------ hassan.schroeder@gmail.com > http://about.me/hassanschroeder > twitter: @hassan > The OS is Windows 2003. I can open the file from the cmd line (not IRB), and when I hardcode the path in File.open(\\\\sdcfaxgw04\\c$\\epic\\jobs\\Processed\\7.7.7\\Epic Print Service\\xxx) it works fine. I created the variable by combining two other variables, and when I try the File.exists? it fails. If I assign the complete path including file (i.e. \\\\sdcfaxgw04\\c$\\epic\\jobs\\Processed\\7.7.7\\Epic Print Service\\sd3n4v1.20110902.1924.55435838.JMym.epic) it works fine. Could it be the way I'm creating the variable? This is the process: ertf = "\\\\sdcfaxgw04\\c$\\epic\\jobs\\Processed\\7.7.7\\Epic Print Service\\"+filevariable Jeff