[fs.op.copy.symlink]

# 31 Input/output library [[input.output]](./#input.output)

## 31.12 File systems [[filesystems]](filesystems#fs.op.copy.symlink)

### 31.12.13 Filesystem operation functions [[fs.op.funcs]](fs.op.funcs#fs.op.copy.symlink)

#### 31.12.13.6 Copy symlink [fs.op.copy.symlink]

[ð](#lib:copy_symlink)

`void filesystem::copy_symlink(const path& existing_symlink, const path& new_symlink);
void filesystem::copy_symlink(const path& existing_symlink, const path& new_symlink,
                              error_code& ec) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L17520)

*Effects*: Equivalent to*function*(read_symlink(existing_symlink), new_symlink) or  

*function*(read_symlink(existing_symlink, ec), new_symlink, ec), respectively,
 where in each case *function* is create_symlink or create_directory_symlink as appropriate[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L17528)

*Throws*: As specified in [[fs.err.report]](fs.err.report "31.12.5 Error reporting")[.](#2.sentence-1)
