Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > FileUtils cp_r

Reply
Thread Tools

FileUtils cp_r

 
 
Newb Newb
Guest
Posts: n/a
 
      04-25-2009
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
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Hunt Jon
Guest
Posts: n/a
 
      04-25-2009
Maybe you can use

unless File.exists?(destination) or Dir.exists?(desitination)
cp_r(source,destination)
end

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileUtils.cp_r - works with regex? Edouard Dantes Ruby 2 02-09-2009 10:51 AM
FileUtils.cp_r is slow? Paul Lynch Ruby 5 01-19-2009 08:39 AM
FileUtils.cp_r Marc Heiler Ruby 3 07-19-2008 06:31 PM
FILEUTILS cp/cp_r rm/rm_r on Windows XP James Byrne Ruby 2 03-31-2008 02:13 AM
get new files in dstdir before cp_r Rebhan, Gilbert Ruby 1 02-27-2007 10:45 AM



Advertisments