aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.cpp')
-rw-r--r--src/common/util.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp
index 829f4605c..a60c79d3a 100644
--- a/src/common/util.cpp
+++ b/src/common/util.cpp
@@ -115,6 +115,24 @@ static int flock_exnb(int fd)
namespace tools
{
+
+ void copy_file(const std::string& from, const std::string& to)
+ {
+ using boost::filesystem::path;
+ #if BOOST_VERSION < 107400
+ // Remove this preprocessor if/else when we are bumping the boost version.
+ boost::filesystem::copy_file(
+ path(from),
+ path(to),
+ boost::filesystem::copy_option::overwrite_if_exists);
+ #else
+ boost::filesystem::copy_file(
+ path(from),
+ path(to),
+ boost::filesystem::copy_options::overwrite_existing);
+ #endif
+ }
+
std::function<void(int)> signal_handler::m_handler;
private_file::private_file() noexcept : m_handle(), m_filename() {}