我是否缺少 move() 函数?我想出的最好的办法是硬链接(hard link)拷贝,然后删除原始拷贝,但这并不能让我充满信心,必须手动管理这两个操作,也不能跨文件系统工作。
最佳答案
这不叫 move ,而是叫重命名。
Moves or renames the filesystem object identified by old_p to new_p as if by the POSIX rename
void rename(const std::filesystem::path& old_p,
const std::filesystem::path& new_p);
void rename(const std::filesystem::path& old_p, // (since C++17)
const std::filesystem::path& new_p,
std::error_code& ec) noexcept;
关于c++ - 我是否缺少 <experimental/filesystem> move 操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51097528/