- if (!sys::exists (file_path)) return false;
-
- sys::path backup_path(file_path.to_string() + backup_suffix);
-
- try
- {
- sys::copy_file (file_path, backup_path);
- }
- catch(sys::filesystem_error& ex)
- {
- error << string_compose (_("Unable to create a backup copy of file %1 (%2)"),
- file_path.to_string(), ex.what())
- << endmsg;
- return false;
- }
- return true;