From: "Peña, Botp" Date: 2006-04-21T10:06:46+09:00 Subject: Re: Questions about copying using FileUtils Peter Bailey wrote last Thursday, April 20, 2006 10:42 PM: # As a related question, do all iterators, like my "each" # below, require an "end?" maybe we ask first "what is a block?" :) # Dir.chdir("c:/scripts/ruby/temp") # require 'fileutils' # include FileUtils::Verbose # psfiles = Dir.glob('*.ps') # psfiles.collect!{ |psfile| File.basename(psfile, '.ps') } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lose this line. you do not really need it ;) # psfiles.each do |psfile| # puts psfile # FileUtils.cp("psfile", psfile + ".pageinfo") ^^^^^^^^^ lose the quotes ;) thus, your copy will look like sample.ps.pageinfo. I prefer this one so i can trace where my backups/copy came from originally (and it resolves duplicate basenames, too) # end kind regards -botp