Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby file force copy

Tags:

file

copy

ruby

Is there a way to get ruby to do a forced copy? FileUtils.cp_r seems not to have a :force => true option.

like image 779
Aaron Lee Avatar asked Mar 06 '09 22:03

Aaron Lee


2 Answers

No, but it does have :remove_destination as an option, which does much the same thing.

like image 143
Pesto Avatar answered Nov 13 '22 07:11

Pesto


If you're using FileUtils.cp to copy a single file, overwriting the target file if it exists is the default behavior; no "force" or similar option is necessary.

like image 44
Jon Schneider Avatar answered Nov 13 '22 07:11

Jon Schneider