[fs.op.symlink.status]

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

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

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

#### 31.12.13.38 Symlink status [fs.op.symlink.status]

[ð](#lib:symlink_status)

`file_status filesystem::symlink_status(const path& p);
file_status filesystem::symlink_status(const path& p, error_code& ec) noexcept;
`

[1](#1)

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

*Effects*: Same as status, above,
 except that the attributes
 of p are determined as if by using POSIX lstat to obtain a POSIX struct stat[.](#1.sentence-1)

[2](#2)

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

Let prms denote the result of (m & perms​::​mask),
where m is determined as if by converting the st_mode member
of the obtained struct stat to the type perms[.](#2.sentence-1)

[3](#3)

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

*Returns*: Same as status, above, except
 that if the attributes indicate a symbolic link, as if by POSIX S_ISLNK,
 returns file_status(file_type​::​symlink, prms)[.](#3.sentence-1)

The signature with argument ec returns file_status(file_type​::​none) if an error occurs[.](#3.sentence-2)

[4](#4)

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

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

[5](#5)

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

*Remarks*: Pathname resolution terminates if p names a symbolic link[.](#5.sentence-1)
