JohnDoe
JohnDoe

Reputation: 915

copy file from source to dest even if file exist in dest with ruby?

as I understand, the following line should copy files even if the file exist already within the destination folder:

FileUtils.cp_r(source, 'destination')

I get the EACCES error:

fileutils.rb:1402:in `initialize': Permission denied @ rb_sysopen ...

Which means I can not overwrite the already existing file.

How to overwrite files with same name using FileUtils.cp_r?

Upvotes: 1

Views: 4433

Answers (1)

ilan berci
ilan berci

Reputation: 3881

send in remove_destination: true in your options block

Upvotes: 2

Related Questions