首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::filesystem::copy_symlink

Defined in header <filesystem>

?

?

void copy_symlink( const std::filesystem::path& from, const std::filesystem::path& to);

(1)

(since C++17)

void copy_symlink( const std::filesystem::path& from, const std::filesystem::path& to, std::error_code& ec );

(2)

(since C++17)

将符号链接复制到另一个位置。

1%29有效呼叫f(read_symlink(from), to)何地fcreate_symlinkcreate_directory_symlink取决于from解析为文件或目录。

2%29有效呼叫f(read_symlink(from, ec), to, ec)何地fcreate_symlinkcreate_directory_symlink取决于from解析为文件或目录。

参数

from

-

path to a symbolic link to copy

to

-

destination path of the new symlink

ec

-

out-parameter for error reporting in the non-throwing overload

返回值

%280%29

例外

不占用std::error_code&参数抛文件系统[医]误差关于基础OS API错误,使用from作为第一个论点,to作为第二个参数,操作系统错误代码作为错误代码参数。std::bad_alloc如果内存分配失败,则可能引发。过载std::error_code&参数,如果OSAPI调用失败,则将其设置为OSAPI错误代码,并执行ec.clear()如果没有错误发生。这个过载

noexcept规格:

noexcept

另见

copy (C++17)

copies files or directories (function)

copy_file (C++17)

copies file contents (function)

create_symlinkcreate_directory_symlink (C++17)(C++17)

creates a symbolic link (function)

read_symlink (C++17)

obtains the target of a symbolic link (function)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com