From: Robert Klemme Date: 2011-09-26T20:04:55+09:00 Subject: Re: FileUtils head-scratcher... On Sun, Sep 25, 2011 at 6:58 PM, Reid Thompson wrote: > On 9/25/2011 12:22 PM, Chuck Remes wrote: >> >> require 'fileutils' >> >> def makedir(name) >>  FileUtils.mkdir name unless File.exists?(name)&&  File.directory?(name) >> end >> >> makedir('dir') >> Dir.chdir('dir') do >>  makedir('subdir') >>  Dir.chdir('subdir') do >>    5.times {|i|  FileUtils.touch i.to_s } >>    makedir('subsubdir') >>    Dir.chdir('subsubdir') do >>      5.times {|i|  FileUtils.touch i.to_s } >>    end >>  end >> >>  subdir = Dir.glob("subdir/*") >>  FileUtils.mv subdir, '.', :verbose =>  true >> end > > add > > :force =>  true > > to the call to > FileUtils.mv subdir, '.', :verbose =>  true Chuck, you should also be aware that you move directories up one level as well. Is this what you want? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/