Namespaces
Variants

std::experimental::filesystem:: copy_symlink

From cppreference.net
定义于头文件 <experimental/filesystem>
void copy_symlink ( const path & from, const path & to ) ;
(1) (文件系统 TS)
void copy_symlink ( const path & from, const path & to,
error_code & ec ) ;
(2) (文件系统 TS)

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

1) 实际上调用 f ( read_symlink ( from ) , to ) ,其中 f create_symlink ( ) create_directory_symlink ,具体取决于 from 解析为文件还是目录。
2) 实际上调用 f ( read_symlink ( from, ec ) , to, ec ) ,其中 f create_symlink ( ) create_directory_symlink ,具体取决于 from 解析为文件还是目录。

目录

参数

from - 要复制的符号链接路径
to - 新符号链接的目标路径
ec - 非抛出重载中用于错误报告的输出参数

返回值

(无)

异常

The overload that does not take an error_code & parameter throws filesystem_error on underlying OS API errors, constructed with from as the first argument, to as the second argument, and the OS error code as the error code argument. std:: bad_alloc may be thrown if memory allocation fails. The overload taking an error_code & parameter sets it to the OS API error code if an OS API call fails, and executes ec. clear ( ) if no errors occur. This overload has
noexcept 规范:
noexcept

参见

复制文件或目录
(函数)
复制文件内容
(函数)
创建符号链接
(函数)
获取符号链接的目标
(函数)