---
name: "std::filesystem::directory_entry"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::filesystem::directory_entry/3cxx"
---

# std::filesystem::directory\_entry(3cxx)

The value type used by directory iterators.

## NAME

std::filesystem::directory\_entry - The value type used by directory iterators.

## SYNOPSIS

`#include <filesystem>`

### Public Member Functions

**directory\_entry** (const **directory\_entry** &)=**default**\
 **directory\_entry** (const **filesystem::path** &\_\_p)\
 **directory\_entry** (const **filesystem::path** &\_\_p, **error\_code** &**\_\_ec**)\
 **directory\_entry** (**directory\_entry** &&) noexcept=**default**\
 **void** **assign** (const **filesystem::path** &\_\_p)\
 **void** **assign** (const **filesystem::path** &\_\_p, **error\_code** &**\_\_ec**)\
 bool **exists** () const\
 bool **exists** (**error\_code** &**\_\_ec**) const noexcept\
 uintmax\_t **file\_size** () const\
 uintmax\_t **file\_size** (**error\_code** &**\_\_ec**) const noexcept\
 uintmax\_t **hard\_link\_count** () const\
 uintmax\_t **hard\_link\_count** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_block\_file** () const\
 bool **is\_block\_file** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_character\_file** () const\
 bool **is\_character\_file** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_directory** () const\
 bool **is\_directory** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_fifo** () const\
 bool **is\_fifo** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_other** () const\
 bool **is\_other** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_regular\_file** () const\
 bool **is\_regular\_file** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_socket** () const\
 bool **is\_socket** (**error\_code** &**\_\_ec**) const noexcept\
 bool **is\_symlink** () const\
 bool **is\_symlink** (**error\_code** &**\_\_ec**) const noexcept\
 **file\_time\_type** **last\_write\_time** () const\
 **file\_time\_type** **last\_write\_time** (**error\_code** &**\_\_ec**) const noexcept\
 **operator const filesystem::path &** () const noexcept\
 bool **operator!=** (const **directory\_entry** &**\_\_rhs**) const noexcept\
 bool **operator\<** (const **directory\_entry** &**\_\_rhs**) const noexcept\
 bool **operator\<=** (const **directory\_entry** &**\_\_rhs**) const noexcept\
 **directory\_entry** & **operator=** (const **directory\_entry** &)=**default**\
 **directory\_entry** & **operator=** (**directory\_entry** &&) noexcept=**default**\
 bool **operator==** (const **directory\_entry** &**\_\_rhs**) const noexcept\
 bool **operator\>** (const **directory\_entry** &**\_\_rhs**) const noexcept\
 bool **operator\>=** (const **directory\_entry** &**\_\_rhs**) const noexcept\
 const **filesystem::path** & **path** () const noexcept\
 **void** **refresh** ()\
 **void** **refresh** (**error\_code** &**\_\_ec**) noexcept\
 **void** **replace\_filename** (const **filesystem::path** &\_\_p)\
 **void** **replace\_filename** (const **filesystem::path** &\_\_p, **error\_code** &**\_\_ec**)\
 **file\_status** **status** () const\
 **file\_status** **status** (**error\_code** &**\_\_ec**) const noexcept\
 **file\_status** **symlink\_status** () const\
 **file\_status** **symlink\_status** (**error\_code** &**\_\_ec**) const noexcept\

### Friends

**struct** **\_Dir**\
 **class** **directory\_iterator**\
 template\<**typename** \_CharT , **typename** \_Traits \> **basic\_ostream**\< \_CharT, \_Traits \> & **operator\<\<** (**basic\_ostream**\< \_CharT, \_Traits \> &**\_\_os**, const **directory\_entry** &\_\_d)\
 **class** **recursive\_directory\_iterator**\

## Detailed Description

The value type used by directory iterators.

**Since**

C++17

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
