Forum: Ruby Re: Questions about copying using FileUtils

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Peña, Botp (Guest)
on 2006-04-21 05:08
(Received via mailing list)
Peter B. 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 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
This topic is locked and can not be replied to.