From: Arup Rakshit Date: 2013-01-31T00:29:25+09:00 Subject: Re: How to copy the directory files only to another directory? Joel Pearson wrote in post #1094382: > 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 Nice idea! But as an example i used such .txt,.pdf extensions. But there can be various types of files, all I have to copy. But not any folder or directories. -- Posted via http://www.ruby-forum.com/.