[fs.op.exists]

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

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

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

#### 31.12.13.14 Exists [fs.op.exists]

[ð](#lib:exists)

`bool filesystem::exists(file_status s) noexcept;
`

[1](#1)

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

*Returns*: status_known(s) && s.type() != file_type​::​not_found[.](#1.sentence-1)

[ð](#lib:exists_)

`bool filesystem::exists(const path& p);
bool filesystem::exists(const path& p, error_code& ec) noexcept;
`

[2](#2)

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

Let s be a file_status,
determined as if by status(p) or status(p, ec), respectively[.](#2.sentence-1)

[3](#3)

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

*Effects*: The signature with argument ec calls ec.clear() if status_known(s)[.](#3.sentence-1)

[4](#4)

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

*Returns*: exists(s)[.](#4.sentence-1)

[5](#5)

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

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