copy check only if path is on removable device

This commit is contained in:
David Kocik 2019-12-18 14:09:16 +01:00
parent 11f07f277f
commit ef250ad539
3 changed files with 5 additions and 5 deletions

View file

@ -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 &copy)