mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-07-03 17:05:43 +02:00
copy check only if path is on removable device
This commit is contained in:
@@ -65,7 +65,7 @@ extern std::string normalize_utf8_nfc(const char *src);
|
||||
extern std::error_code 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);
|
||||
extern int copy_file(const std::string &from, const std::string &to, const bool with_check = false);
|
||||
|
||||
// Compares two files, returns 0 if identical.
|
||||
extern int check_copy(const std::string& origin, const std::string& copy);
|
||||
|
||||
@@ -417,7 +417,7 @@ std::error_code rename_file(const std::string &from, const std::string &to)
|
||||
#endif
|
||||
}
|
||||
|
||||
int copy_file(const std::string &from, const std::string &to)
|
||||
int copy_file(const std::string &from, const std::string &to, const bool with_check)
|
||||
{
|
||||
const boost::filesystem::path source(from);
|
||||
const boost::filesystem::path target(to);
|
||||
@@ -436,8 +436,7 @@ int copy_file(const std::string &from, const std::string &to)
|
||||
return -1;
|
||||
}
|
||||
boost::filesystem::permissions(target, perms, ec);
|
||||
return -1;
|
||||
return check_copy(from, to);
|
||||
return (with_check ? check_copy(from, to) : 0);
|
||||
}
|
||||
|
||||
int check_copy(const std::string &origin, const std::string ©)
|
||||
|
||||
Reference in New Issue
Block a user