Forum: Ruby FileUtils cp_r

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Newb N. (Guest)
on 2009-04-25 10:12
Hi...

i want to copy a folder recursively

i did it using cp_r(source,destination)

it works correctly.

but it sould not be overwritted...

how can i do it pls help me..

even i used remove_destination => false...

but it gets overwritted...

any advices...

Thanks
Hunt J. (Guest)
on 2009-04-25 19:35
(Received via mailing list)
Maybe you can use

unless File.exists?(destination) or Dir.exists?(desitination)
  cp_r(source,destination)
end
This topic is locked and can not be replied to.