[fs.op.is.regular.file]

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

## 31.12 File systems [[filesystems]](filesystems#fs.op.is.regular.file)

### 31.12.13 Filesystem operation functions [[fs.op.funcs]](fs.op.funcs#fs.op.is.regular.file)

#### 31.12.13.23 Is regular file [fs.op.is.regular.file]

[ð](#lib:is_regular_file)

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

[1](#1)

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

*Returns*: s.type() == file_type​::​regular[.](#1.sentence-1)

[ð](#lib:is_regular_file_)

`bool filesystem::is_regular_file(const path& p);
`

[2](#2)

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

*Returns*: is_regular_file(status(p))[.](#2.sentence-1)

[3](#3)

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

*Throws*: filesystem_error if status(p) would throw filesystem_error[.](#3.sentence-1)

[ð](#lib:is_regular_file__)

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

[4](#4)

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

*Effects*: Sets ec as if by status(p, ec)[.](#4.sentence-1)

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

file_type​::​none, file_type​::​not_found and file_type​::​unknown cases set ec to error values[.](#4.sentence-2)

To distinguish between cases, call the status function directly[.](#4.sentence-3)

â *end note*]

[5](#5)

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

*Returns*: is_regular_file(status(p, ec))[.](#5.sentence-1)

Returns false if an error occurs[.](#5.sentence-2)
