summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session_state_utils.cc')
-rw-r--r--libs/ardour/session_state_utils.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/ardour/session_state_utils.cc b/libs/ardour/session_state_utils.cc
index be71289a17..42551b9945 100644
--- a/libs/ardour/session_state_utils.cc
+++ b/libs/ardour/session_state_utils.cc
@@ -20,6 +20,8 @@
#include <glibmm/fileutils.h>
+#include <giomm/file.h>
+
#include "pbd/compose.h"
#include "pbd/error.h"
#include "pbd/file_utils.h"
@@ -40,13 +42,14 @@ create_backup_file (const std::string & file_path)
{
if (!Glib::file_test (file_path, Glib::FILE_TEST_EXISTS)) return false;
- std::string backup_path(file_path + backup_suffix);
+ Glib::RefPtr<Gio::File> backup_path = Gio::File::create_for_path(file_path + backup_suffix);
+ Glib::RefPtr<Gio::File> path = Gio::File::create_for_path(file_path);
try
{
- sys::copy_file (file_path, backup_path);
+ path->copy (backup_path);
}
- catch(sys::filesystem_error& ex)
+ catch(const Glib::Exception& ex)
{
error << string_compose (_("Unable to create a backup copy of file %1 (%2)"),
file_path, ex.what())