STD::FILESYSTEM_FILESYSTEM_ERROR(3)

πŸ“¦ version 11.5.0, in centos-stream 9

✨ NAME ✨

std::filesystem::filesystem_error β€” the exception type that the Filesystem library throws, straight out of the Library Functions Manual (section 3, bestie, we're in the library functions girlies πŸ’…)


🌸 SYNOPSIS 🌸

It inherits std::system_error. That's the whole vibe. A filesystem_error is a system_error, no cap 🫢

πŸ’– Public Member Functions

  • filesystem_error (const filesystem_error &)=default β€” the defaulted copy constructor, iconic, does exactly what you'd think 🌈
  • filesystem_error (const string &__what_arg, const path &__p1, const path &__p2, error_code __ec) β€” builds one with a what-string, two paths, and an error_code ✨
  • filesystem_error (const string &__what_arg, const path &__p1, error_code __ec) β€” same energy but with just one path and the error_code πŸŽ€
  • filesystem_error (const string &__what_arg, error_code __ec) β€” the minimalist version: what-string + error_code, no paths attached πŸ’œ
  • const error_code & code () const noexcept β€” hands you the error_code back, noexcept so she's safe πŸ“
  • filesystem_error & operator= (const filesystem_error &)=default β€” defaulted copy assignment, and yes she returns filesystem_error & 😌
  • const path & path1 () const noexcept β€” the first path, noexcept, cute πŸ¦‹
  • const path & path2 () const noexcept β€” the second path, also noexcept 🧚
  • const char * what () const noexcept β€” the C-style string explaining the drama, noexcept 🌺

πŸ¦‹ Detailed Description πŸ¦‹

Okay so real talk: std::filesystem::filesystem_error is the exception type thrown by the Filesystem library. That's the entire description and honestly she ate πŸ”₯


πŸŽ€ Member Function Documentation πŸŽ€

const char* std::filesystem::filesystem_error::what () const [virtual], [noexcept]

Returns a C-style character string that describes the general cause of the current error β€” and it's literally the same string you passed to the ctor, so no surprise plot twists here 😭

Reimplemented from std::runtime_error. periodt πŸ‘‘


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a robot doing her little robot thing πŸ€–πŸ’–


And that's the whole page bestie!! This gorgeous piece of documentation was brought to you by libstdc++, dated Wed Oct 7 2026 β€” go forth and catch those filesystem exceptions responsibly πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from