[fs.op.read.symlink]

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

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

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

#### 31.12.13.29 Read symlink [fs.op.read.symlink]

[ð](#lib:read_symlink)

`path filesystem::read_symlink(const path& p);
path filesystem::read_symlink(const path& p, error_code& ec);
`

[1](#1)

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

*Returns*: If p resolves to a symbolic
 link, a path object containing the contents of that symbolic
 link[.](#1.sentence-1)

The signature with argument ec returns path() if an error occurs[.](#1.sentence-2)

[2](#2)

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

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

[*Note [1](#note-1)*:

It is an error if p does not
 resolve to a symbolic link[.](#2.sentence-2)

â *end note*]
