std::files...tory_entry(3)

πŸ’– NAME πŸ’–

std::filesystem::directory_entry β€” the value type used by directory iterators. That's the whole job description, and she does it flawlessly.

Okay so hi bestie, welcome to the Library Functions Manual 🌸 this is the page for std::filesystem::directory_entry, the little icon that directory iterators hand you when they walk past an entry. Let's get into it πŸ’…


✨ SYNOPSIS ✨

#include <filesystem>

πŸŽ€ Public Member Functions πŸŽ€

  • directory_entry (const directory_entry &)=default β€” copy constructor, defaulted, zero notes, pure vibes.
  • directory_entry (const filesystem::path &__p) β€” build one from a filesystem::path.
  • directory_entry (const filesystem::path &__p, error_code &__ec) β€” same thing but it takes an error_code &__ec along for the ride.
  • directory_entry (directory_entry &&) noexcept=default β€” move constructor, defaulted, noexcept, iconic.
  • void assign (const filesystem::path &__p) β€” assign a new filesystem::path.
  • void assign (const filesystem::path &__p, error_code &__ec) β€” the error_code &__ec twin.
  • bool exists () const β€” does it exist, yes or no, const.
  • bool exists (error_code &__ec) const noexcept β€” the error_code &__ec version, const and noexcept.
  • uintmax_t file_size () const β€” size of the file, as a uintmax_t.
  • uintmax_t file_size (error_code &__ec) const noexcept β€” with error_code &__ec, const, noexcept.
  • uintmax_t hard_link_count () const β€” how many hard links, as a uintmax_t.
  • uintmax_t hard_link_count (error_code &__ec) const noexcept β€” error_code &__ec flavour, const, noexcept.
  • bool is_block_file () const β€” is it a block file? const bool, bestie.
  • bool is_block_file (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.
  • bool is_character_file () const β€” character file check, const.
  • bool is_character_file (error_code &__ec) const noexcept β€” with error_code &__ec, const, noexcept.
  • bool is_directory () const β€” directory check, const.
  • bool is_directory (error_code &__ec) const noexcept β€” error_code &__ec twin, const, noexcept.
  • bool is_fifo () const β€” FIFO check, const.
  • bool is_fifo (error_code &__ec) const noexcept β€” error_code &__ec twin, const, noexcept.
  • bool is_other () const β€” the "none of the above" check, const.
  • bool is_other (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.
  • bool is_regular_file () const β€” regular file check, const.
  • bool is_regular_file (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.
  • bool is_socket () const β€” socket check, const.
  • bool is_socket (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.
  • bool is_symlink () const β€” symlink check, const.
  • bool is_symlink (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.
  • file_time_type last_write_time () const β€” last write time, returned as a file_time_type.
  • file_time_type last_write_time (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.
  • operator const filesystem::path & () const noexcept β€” implicit conversion to const filesystem::path &, const, noexcept, slay.
  • strong_ordering operator<=> (const directory_entry &__rhs) const noexcept β€” the spaceship, returns strong_ordering, takes const directory_entry &__rhs, const, noexcept. three-way comparison ate and left no crumbs πŸš€
  • directory_entry & operator= (const directory_entry &)=default β€” copy assignment, defaulted.
  • directory_entry & operator= (directory_entry &&) noexcept=default β€” move assignment, defaulted, noexcept.
  • bool operator== (const directory_entry &__rhs) const noexcept β€” equality against const directory_entry &__rhs, const, noexcept.
  • const filesystem::path & path () const noexcept β€” hands you the const filesystem::path &, const, noexcept.
  • void refresh () β€” refresh, no args.
  • void refresh (error_code &__ec) noexcept β€” refresh with error_code &__ec, noexcept.
  • void replace_filename (const filesystem::path &__p) β€” swap in a new filename from a filesystem::path.
  • void replace_filename (const filesystem::path &__p, error_code &__ec) β€” with error_code &__ec.
  • file_status status () const β€” returns a file_status, const.
  • file_status status (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.
  • file_status symlink_status () const β€” returns a file_status, const.
  • file_status symlink_status (error_code &__ec) const noexcept β€” error_code &__ec version, const, noexcept.

🫢 Friends 🫢

the inner circle. the group chat. the ones who get to see behind the curtain πŸ”₯

  • struct _Dir
  • class directory_iterator
  • template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits > & operator<< (basic_ostream< _CharT, _Traits > &__os, const directory_entry &__d) β€” yes bestie she streams, she's printable, she's in your basic_ostream< _CharT, _Traits > πŸ’–
  • class recursive_directory_iterator

πŸ’… Detailed Description πŸ’…

The value type used by directory iterators. that's it. that's the detailed description. she said what she said πŸŽ€

⭐ Since ⭐

C++17


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. no cap, a robot wrote this and honestly? it ate.


ok that's the whole page bestie, every signature accounted for, nothing skipped, nothing invented. go forth and iterate πŸ¦‹

and that's a wrap on std::files...tory_entry(3) from the libstdc++ girlies β€” mwah πŸ’‹ 🫢 </final>

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms