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.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-04-25 08: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
9239e324751b8db551789e5e16689438?d=identicon&s=25 Hunt Jon (Guest)
on 2009-04-25 17: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.