From: Joel Pearson Date: 2013-01-31T00:21:10+09:00 Subject: Re: How to copy the directory files only to another directory? There are a few ways to do this, this one seems to work: Dir.chdir 'C:/' files = Dir.glob('**/*.pdf') + Dir.glob('**/*.txt') + Dir.glob('**/*.docx') files.each do |fname| File.rename File.absolute_path(fname), 'D:/document/' + File.basename(fname) end -- Posted via http://www.ruby-forum.com/.