How to catch errors when copying files in Ruby?
-
20-04-2021 - |
Domanda
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?
Soluzione
Because it is not documented, you have to check the source.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow