Aaron Lee
Aaron Lee

Reputation: 5457

Ruby file force copy

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

Upvotes: 7

Views: 4901

Answers (2)

Jon Schneider
Jon Schneider

Reputation: 26973

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.

Upvotes: 4

Pesto
Pesto

Reputation: 23880

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

Upvotes: 12

Related Questions