9 void move_file(
const path& source,
const path& dest,
bool overwriteExisting, std::error_code& ec)
11 auto options = copy_options::none;
12 if (overwriteExisting)
14 options |= copy_options::overwrite_existing;
17 if (copy_file(source, dest, options, ec) &&
24 void fastmove_file(
const path& source,
const path& dest,
bool overwriteExisting, std::error_code& ec)
36 if (!overwriteExisting)
38 std::error_code existsEc;
39 const bool destExists = exists(dest, existsEc);
47 ec = std::make_error_code(std::errc::file_exists);
52 rename(source, dest, ec);
53 if (ec.value() ==
static_cast<int>(std::errc::cross_device_link))
55 move_file(source, dest, overwriteExisting, ec);