[fs.dir.entry.cons]

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

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

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

#### 31.12.10.2 Constructors [fs.dir.entry.cons]

[ð](#lib:directory_entry,constructor)

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

[1](#1)

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

*Effects*: Calls refresh() or refresh(ec), respectively[.](#1.sentence-1)

[2](#2)

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

*Postconditions*: path() == p if no error occurs,
otherwise path() == filesystem​::​path()[.](#2.sentence-1)

[3](#3)

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

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