Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2018-09-14 10:28:00 +0300
committerbubnikv <bubnikv@gmail.com>2018-09-14 10:28:00 +0300
commit9d9e4a0f7b2d9d3440c2a05bc65b2cab707d148a (patch)
treee57a7cb171afe5efa6381a73ad02dcbce3050826 /xs/src/libslic3r/Utils.hpp
parentbb70ad609025a259f35f4f21e2fc9587c7a3fc2d (diff)
WIP: Background processing.
Diffstat (limited to 'xs/src/libslic3r/Utils.hpp')
-rw-r--r--xs/src/libslic3r/Utils.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Utils.hpp b/xs/src/libslic3r/Utils.hpp
index f1390b8a2..dd05891dd 100644
--- a/xs/src/libslic3r/Utils.hpp
+++ b/xs/src/libslic3r/Utils.hpp
@@ -43,6 +43,14 @@ extern local_encoded_string encode_path(const char *src);
extern std::string decode_path(const char *src);
extern std::string normalize_utf8_nfc(const char *src);
+// Safely rename a file even if the target exists.
+// On Windows, the file explorer (or anti-virus or whatever else) often locks the file
+// for a short while, so the file may not be movable. Retry while we see recoverable errors.
+extern int rename_file(const std::string &from, const std::string &to);
+
+// Copy a file, adjust the access attributes, so that the target is writable.
+extern int copy_file(const std::string &from, const std::string &to);
+
// File path / name / extension splitting utilities, working with UTF-8,
// to be published to Perl.
namespace PerlUtils {