[fs.dir.entry.obs]

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

## 31.12 File systems [[filesystems]](filesystems#fs.dir.entry.obs)

### 31.12.10 Class directory_entry [[fs.class.directory.entry]](fs.class.directory.entry#fs.dir.entry.obs)

#### 31.12.10.4 Observers [fs.dir.entry.obs]

[1](#1)

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

Unqualified function names in the *Returns*: elements of thedirectory_entry observers described below refer to members of thestd​::​filesystem namespace[.](#1.sentence-1)

[ð](#lib:path,directory_entry)

`const filesystem::path& path() const noexcept;
operator const filesystem::path&() const noexcept;
`

[2](#2)

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

*Returns*: *path-object*[.](#2.sentence-1)

[ð](#lib:exists,directory_entry)

`bool exists() const;
bool exists(error_code& ec) const noexcept;
`

[3](#3)

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

*Returns*: exists(this->status()) or exists(this->status(ec)), respectively[.](#3.sentence-1)

[4](#4)

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

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

[ð](#lib:is_block_file,directory_entry)

`bool is_block_file() const;
bool is_block_file(error_code& ec) const noexcept;
`

[5](#5)

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

*Returns*: is_block_file(this->status()) or is_block_file(this->status(ec)), respectively[.](#5.sentence-1)

[6](#6)

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

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

[ð](#lib:is_character_file,directory_entry)

`bool is_character_file() const;
bool is_character_file(error_code& ec) const noexcept;
`

[7](#7)

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

*Returns*: is_character_file(this->status()) or is_character_file(this->status(ec)), respectively[.](#7.sentence-1)

[8](#8)

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

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

[ð](#lib:is_directory,directory_entry)

`bool is_directory() const;
bool is_directory(error_code& ec) const noexcept;
`

[9](#9)

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

*Returns*: is_directory(this->status()) or is_directory(this->status(ec)), respectively[.](#9.sentence-1)

[10](#10)

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

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

[ð](#lib:is_fifo,directory_entry)

`bool is_fifo() const;
bool is_fifo(error_code& ec) const noexcept;
`

[11](#11)

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

*Returns*: is_fifo(this->status()) or is_fifo(this->status(ec)), respectively[.](#11.sentence-1)

[12](#12)

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

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

[ð](#lib:is_other,directory_entry)

`bool is_other() const;
bool is_other(error_code& ec) const noexcept;
`

[13](#13)

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

*Returns*: is_other(this->status()) or is_other(this->status(ec)), respectively[.](#13.sentence-1)

[14](#14)

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

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

[ð](#lib:is_regular_file,directory_entry)

`bool is_regular_file() const;
bool is_regular_file(error_code& ec) const noexcept;
`

[15](#15)

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

*Returns*: is_regular_file(this->status()) or is_regular_file(this->status(ec)), respectively[.](#15.sentence-1)

[16](#16)

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

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

[ð](#lib:is_socket,directory_entry)

`bool is_socket() const;
bool is_socket(error_code& ec) const noexcept;
`

[17](#17)

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

*Returns*: is_socket(this->status()) or is_socket(this->status(ec)), respectively[.](#17.sentence-1)

[18](#18)

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

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

[ð](#lib:is_symlink,directory_entry)

`bool is_symlink() const;
bool is_symlink(error_code& ec) const noexcept;
`

[19](#19)

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

*Returns*: is_symlink(this->symlink_status()) or is_symlink(this->symlink_status(ec)), respectively[.](#19.sentence-1)

[20](#20)

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

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

[ð](#lib:file_size,directory_entry)

`uintmax_t file_size() const;
uintmax_t file_size(error_code& ec) const noexcept;
`

[21](#21)

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

*Returns*: If cached, the file size attribute value[.](#21.sentence-1)

Otherwise, file_size(path()) or file_size(path(), ec), respectively[.](#21.sentence-2)

[22](#22)

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

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

[ð](#lib:hard_link_count,directory_entry)

`uintmax_t hard_link_count() const;
uintmax_t hard_link_count(error_code& ec) const noexcept;
`

[23](#23)

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

*Returns*: If cached, the hard link count attribute value[.](#23.sentence-1)

Otherwise, hard_link_count(path()) or hard_link_count(path(), ec), respectively[.](#23.sentence-2)

[24](#24)

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

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

[ð](#lib:last_write_time,directory_entry)

`file_time_type last_write_time() const;
file_time_type last_write_time(error_code& ec) const noexcept;
`

[25](#25)

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

*Returns*: If cached, the last write time attribute value[.](#25.sentence-1)

Otherwise, last_write_time(path()) or last_write_time(path(), ec), respectively[.](#25.sentence-2)

[26](#26)

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

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

[ð](#lib:status,directory_entry)

`file_status status() const;
file_status status(error_code& ec) const noexcept;
`

[27](#27)

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

*Returns*: If cached, the status attribute value[.](#27.sentence-1)

Otherwise, status(path()) or status(path(), ec), respectively[.](#27.sentence-2)

[28](#28)

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

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

[ð](#lib:symlink_status,directory_entry)

`file_status symlink_status() const;
file_status symlink_status(error_code& ec) const noexcept;
`

[29](#29)

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

*Returns*: If cached, the symlink status attribute value[.](#29.sentence-1)

Otherwise, symlink_status(path()) or symlink_status(path(), ec), respectively[.](#29.sentence-2)

[30](#30)

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

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

[ð](#lib:operator==,directory_entry)

`bool operator==(const directory_entry& rhs) const noexcept;
`

[31](#31)

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

*Returns*: *path-object* == rhs.*path-object*[.](#31.sentence-1)

[ð](#lib:operator%3c=%3e,directory_entry)

`strong_ordering operator<=>(const directory_entry& rhs) const noexcept;
`

[32](#32)

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

*Returns*: *path-object* <=> rhs.*path-object*[.](#32.sentence-1)
