From: Peter Hickman Date: 2012-11-08T18:12:41+09:00 Subject: Re: Need help improving this FileUtils.cp of an array of destinations --e89a8f83a9099e3c5a04cdf83c10 Content-Type: text/plain; charset=ISO-8859-1 Well I played a little with the code $files = ['path1/','path2/','path3/'] $old_home = 'Old_Home' $sName = 'S_Name' and changed the FileCopy to puts "#{$old_home}/#{$sName}", "#{Dir.pwd}/#{element}" and this is what the output looks like Old_Home/S_Name /tmp/path1/ Old_Home/S_Name /tmp/path2/ Old_Home/S_Name /tmp/path3/ Old_Home/S_Name /tmp/path1/ Old_Home/S_Name /tmp/path2/ Old_Home/S_Name /tmp/path3/ Old_Home/S_Name /tmp/path1/ Old_Home/S_Name /tmp/path2/ Old_Home/S_Name /tmp/path3/ The code you gave is broken and is not doing what you think it is. --e89a8f83a9099e3c5a04cdf83c10 Content-Type: text/html; charset=ISO-8859-1 Well I played a little with the code

$files = ['path1/','path2/','path3/']

$old_home = 'Old_Home'
$sName = 'S_Name'

and changed the FileCopy to

puts "#{$old_home}/#{$sName}", "#{Dir.pwd}/#{element}"

and this is what the output looks like

Old_Home/S_Name /tmp/path1/
Old_Home/S_Name /tmp/path2/
Old_Home/S_Name /tmp/path3/
Old_Home/S_Name /tmp/path1/
Old_Home/S_Name /tmp/path2/
Old_Home/S_Name /tmp/path3/
Old_Home/S_Name /tmp/path1/
Old_Home/S_Name /tmp/path2/
Old_Home/S_Name /tmp/path3/

The code you gave is broken and is not doing what you think it is.

--e89a8f83a9099e3c5a04cdf83c10--