Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to catch errors when copying files in Ruby?

I copy a file like this:

require 'fileutils'
FileUtils.copy(source_file, dest_file)

I would like to know if this operation succeeded, and if not, what was the error.

Where could I find the exceptions that can be thrown?

like image 275
Misha Moroshko Avatar asked Jul 06 '26 19:07

Misha Moroshko


1 Answers

Because it is not documented, you have to check the source.

like image 192
KARASZI István Avatar answered Jul 10 '26 06:07

KARASZI István