是否缺少 <experimental/filesystem> 移动操作?
Is there an <experimental/filesystem> move operation I am missing?
我是否缺少 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;
我是否缺少 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;