From: Chuck Remes Date: 2011-09-26T21:54:09+09:00 Subject: Re: FileUtils head-scratcher... On Sep 26, 2011, at 6:04 AM, Robert Klemme wrote: > 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? Robert, yes, my original message (first line) said that was my goal. BTW, adding the :force => true option made this work. I am still puzzled as to why (I should probably look at the underlying implementation) but I am satisfied for now. Thanks all for the help. cr