On Sun, Sep 25, 2011 at 6:58 PM, Reid Thompson <reid.thompson / ateb.com> wro=
te:
> On 9/25/2011 12:22 PM, Chuck Remes wrote:
>>
>> require 'fileutils'
>>
>> def makedir(name)
>> =A0FileUtils.mkdir name unless File.exists?(name)&& =A0File.directory?(n=
ame)
>> end
>>
>> makedir('dir')
>> Dir.chdir('dir') do
>> =A0makedir('subdir')
>> =A0Dir.chdir('subdir') do
>> =A0 =A05.times {|i| =A0FileUtils.touch i.to_s }
>> =A0 =A0makedir('subsubdir')
>> =A0 =A0Dir.chdir('subsubdir') do
>> =A0 =A0 =A05.times {|i| =A0FileUtils.touch i.to_s }
>> =A0 =A0end
>> =A0end
>>
>> =A0subdir =3D Dir.glob("subdir/*")
>> =A0FileUtils.mv subdir, '.', :verbose =3D> =A0true
>> end
>
> add
>
> :force =3D> =A0true
>
> to the call to
> FileUtils.mv subdir, '.', :verbose =3D> =A0true

Chuck, you should also be aware that you move directories up one level
as well.  Is this what you want?

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/