From: "Alex C." Date: 2012-07-04T18:55:19+09:00 Subject: Re: Copying Files Jan E. wrote in post #1067361: > Alex C. wrote in post #1067360: >> Still doesn't work :( > > What doesn't work? If no file is copied, then it's simply because > there's no "FileUtils.copy". The code above only selects the files that > should be copied. > > >> Does file_path need to be changed to target_path, as that's what I've >> defined above it? > > No, file_path is the block parameter referring to the current file. require 'fileutils' original_path, target_path = 'D:/Stuff/Ruby', 'C:/new' ignore_folder = 'D:/Stuff/Ruby/2/' copy_files = Dir["#{original_path}/**/*.*"].reject do |file_path| file_path.start_with? ignore_folder end FileUtils.copy Dir["#{original_path}/**/*.*"], target_path Thats what I have, and it now copies all the files, but hasn't ignored a file thats in D:/Stuff/Ruby/2/ - which is what I wanted..hmmph -- Posted via http://www.ruby-forum.com/.