My code
#!usrbinenv ruby
require ‘fileutils’
my_dir = Dir["C:/Documents and
Settings/dolinc2/Desktop/talfolder/*.doc"]
(“0000”…“9999”).each do |c|
my_dir.each do |filename|
begin FileUtils.cp( filename, "C:/Documents and
Settings/dolinc2/Desktop/ccfolder/" + c + "/" +
File.basename(filename, “.doc”))
rescue
end
end
end
Ok the only thing here is that even if the file doesn’t match the
directory it still puts a copy of a blank File (with type File) in the
folder
I don’t understand why… =(