OK, I just spent about an hour fooling around and looking up string 
literals, and I'm still having lots of trouble with the *syntax* for 
this utility.  I freely admit it may be that I simply don't understand 
this.

I want an example of how a local variable pathway and a local variable 
name can be used in FileUtils.cp.  Because I cannot get it to work 
cleanly.

filename = "just_a_file"

path1 = Dir.getwd

Dir.mkdir( "move_dir" )
Dir.chdir( move_dir )
path2 = Dir.getwd
Dir.chdir( path1 )

FileUtils.cp( "#{path1 }/#{filename}", "#{path2 }/#{filename}" )

This should work cleanly, since all local variables are within double 
brackets.  It actually does move the file, but still pukes out an 
exception:

Exception `Errno::ENOENT' at 
/home/t3905/ruby/ruby-1.8.7-p22/lib/ruby/site_ruby/1.8/fileutils.rb:1420 
- No such file or directory - 
/home/t3905/test/ruby_move/move_test/just_a_file

So what am I doing wrong??  I completely fail to understand the problem 
here.

-- 
Posted via http://www.ruby-forum.com/.