diff --git a/libs/pbd/copyfile.cc b/libs/pbd/copyfile.cc index 2284a6b26d..b4a654dbe8 100644 --- a/libs/pbd/copyfile.cc +++ b/libs/pbd/copyfile.cc @@ -29,7 +29,7 @@ using namespace PBD; using namespace std; -int +bool PBD::copy_file (Glib::ustring from, Glib::ustring to) { ifstream in (from.c_str()); @@ -37,12 +37,12 @@ PBD::copy_file (Glib::ustring from, Glib::ustring to) if (!in) { error << string_compose (_("Could not open %1 for copy"), from) << endmsg; - return -1; + return false; } if (!out) { error << string_compose (_("Could not open %1 as copy"), to) << endmsg; - return -1; + return false; } out << in.rdbuf(); @@ -50,8 +50,8 @@ PBD::copy_file (Glib::ustring from, Glib::ustring to) if (!in || !out) { error << string_compose (_("Could not copy existing file %1 to %2"), from, to) << endmsg; unlink (to.c_str()); - return -1; + return false; } - return 0; + return true; } diff --git a/libs/pbd/pbd/copyfile.h b/libs/pbd/pbd/copyfile.h index 1e8c5c2a42..f233d68d87 100644 --- a/libs/pbd/pbd/copyfile.h +++ b/libs/pbd/pbd/copyfile.h @@ -21,5 +21,8 @@ namespace PBD { - int copy_file (Glib::ustring from, Glib::ustring to); + /** + * @return true if file was successfully copied + */ + bool copy_file (Glib::ustring from, Glib::ustring to); }