Not a direct answer, but take a look at rio http://rio.rubyforge.org/ ...
it's very easy to use.
rio('adir') >> rio('another_directory')
"Tim Ferrell" <Tim.Ferrell / s0nspark.com> wrote in message
news:433F3D89.2060202 / s0nspark.com...
> I have a small script I am using to relocate a tree of folders and I
notice that
> FileUtils::mv seems to fail silently on moving some of the folders. Here
is the
> relevant snippet:
>
> parent = File.basename(old_parent_dir)
> new_path = File.join(new_base_dir, subsection, parent)
> # move to new path
> begin
> FileUtils::mkdir_p(new_path)
> begin
> FileUtils::mv(current_dir, new_path)
> rescue => err
> puts "unable to move #{current_dir}: #{err}"
> end
> rescue
> puts "unable to create #{new_path}"
> end
>
> I also notice that sometimes FileUtils::mkdir_p throws an exception
claiming it
> can't create the parent path but it does. I'm on Windows XP with
Administrator
> privileges and the drive that the old and new trees reside on is an
external
> firewire drive. Ruby OneClick installer (182_15)...
>
> Any ideas? I'm about to pull my hair out! :-(
>
> Thanks,
> Tim
>
>
>