std::filesy...ory_options(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::filesystem::directory_options πŸ’–

okay bestie, so this is std::filesystem::directory_options from the C++ Standard Library (the cppreference girlies run this one) and honestly? it's giving "tiny enum, huge power." it's the little options menu that tells your directory iterators how to behave. no cap. πŸ¦‹


✨ Synopsis ✨

first things first, she lives here:

Defined in header <filesystem>

and here's literally the whole shape of her:

enum class directory_options {

    none = /* unspecified */,
    follow_directory_symlink = /* unspecified */,  (since C++17)
    skip_permission_denied = /* unspecified */

};

so what is this? this type represents the available options that control the behavior of the directory_iterator and the recursive_directory_iterator. that's her whole job. πŸŽ€

and listen β€” directory_options satisfies the requirements of BitmaskType, which means the bitwise operators operator&, operator|, operator^, operator~, operator&=, operator|=, and operator^= are all defined for this type. every single one. slay. ✨

none represents the empty bitmask, and every other enumerator represents a distinct bitmask element. periodt. πŸ’…


πŸ‘‘ Member constants πŸ‘‘

here's the lineup, main character energy only:

  • none β€” the default. skips directory symlinks, and permission denied is an error. πŸ™ˆ
  • follow_directory_symlink β€” follows directory symlinks instead of skipping them. she's curious like that. πŸ¦‹
  • skip_permission_denied β€” skips directories that would otherwise result in permission denied errors. avoiding the drama, iconic. πŸ’€

🌸 Example 🌸

big mood: this section is incomplete.

Reason: no example

(it's giving "we'll do it later" and honestly, relatable. 😭)


🫢 See also 🫢

  • constructor β€” constructs a directory iterator (public member function of std::filesystem::directory_iterator)
  • constructor β€” constructs a recursive directory iterator (public member function of std::filesystem::recursive_directory_iterator)

πŸŽ€ Category πŸŽ€

  • Todo no example

⭐ cute lil sign-off: this page is straight from http://cppreference.com, version 2024.06.10, and yeah she's indexed as std::filesy...ory_options(3) β€” the truncated name is lowkey a vibe. bye bestie, go enumerate some directories πŸ’œπŸŒˆ

πŸ“¦ where this page comes from