std::filesystem(3)
π std::filesystem π
okay bestie, sit DOWN, because we're doing the C++ Filesystem library and it's honestly iconic. this is std::filesystem β the ISO C++ 2017 namespace for the File System library, and it lives in the Library Functions Manual, section 3. yes queen, section 3, we're in the library functions girlies now π«Ά
β¨ NAME β¨
std::filesystem β the ISO C++ 2017 namespace for the File System library. that's it. that's the name. short, sweet, slays π
πΈ SYNOPSIS πΈ
π Classes π
like, the whole friend group. here's the roster:
class directory_entryβ the value type that directory iterators hand you. it's what you actually get back when you go poking around a folder.class directory_iteratorβ the iterator type for walking the entries inside a single directory. one folder, one iterator, no drama.class file_statusβ info about a file's type and its permissions. the lil ID card of a file, fr.class filesystem_errorβ the exception type the Filesystem library throws when things go sideways πclass pathβ a filesystem path. the main character honestly πclass recursive_directory_iteratorβ the iterator type for recursively walking a whole directory hierarchy. it goes deep. it goes ALL the way down π¦struct space_infoβ info about the free space on a disk. yes, likedf. yes, we love her.
π¦ Typedefs π¦
using file_time_typeβ the type used for file timestamps. that's the whole typedef, bestie.
β Enumerations β
enum class copy_options : unsigned short { none, skip_existing, overwrite_existing, update_existing, recursive, copy_symlinks, skip_symlinks, directories_only, create_symlinks, create_hard_links }β a bitmask type that controls the effects offilesystem::copy. pick your fighter.enum class directory_options : unsigned char { none, follow_directory_symlink, skip_permission_denied }β a bitmask type that controls directory iteration.enum class file_type : signed char { none, not_found, regular, directory, symlink, block, character, fifo, socket, unknown }β an enumerated type representing the type of a file.enum class perm_options : unsigned { replace, add, remove, nofollow }β a bitmask type that controls changes to permissions.enum class perms : unsigned { none, owner_read, owner_write, owner_exec, owner_all, group_read, group_write, group_exec, group_all, others_read, others_write, others_exec, others_all, all, set_uid, set_gid, sticky_bit, mask, unknown }β a bitmask type representing file access permissions. the full chmod vibe check, no cap.
π Functions π
okay so this is the big one. every single one of these, in order, exactly as they are. hydrate first π
path absolute (const path &__p)path absolute (const path &__p, error_code &__ec)path canonical (const path &__p)path canonical (const path &__p, error_code &__ec)void copy (const path &__from, const path &__to)void copy (const path &__from, const path &__to, copy_options __options)void copy (const path &__from, const path &__to, copy_options __options, error_code &)void copy (const path &__from, const path &__to, error_code &__ec)bool copy_file (const path &__from, const path &__to)bool copy_file (const path &__from, const path &__to, copy_options __option)bool copy_file (const path &__from, const path &__to, copy_options __option, error_code &)bool copy_file (const path &__from, const path &__to, error_code &__ec)void copy_symlink (const path &__existing_symlink, const path &__new_symlink)void copy_symlink (const path &__existing_symlink, const path &__new_symlink, error_code &__ec) noexceptbool create_directories (const path &__p)bool create_directories (const path &__p, error_code &__ec)bool create_directory (const path &__p)bool create_directory (const path &__p, const path &__attributes)bool create_directory (const path &__p, const path &__attributes, error_code &__ec) noexceptbool create_directory (const path &__p, error_code &__ec) noexceptvoid create_directory_symlink (const path &__to, const path &__new_symlink)void create_directory_symlink (const path &__to, const path &__new_symlink, error_code &__ec) noexceptvoid create_hard_link (const path &__to, const path &__new_hard_link)void create_hard_link (const path &__to, const path &__new_hard_link, error_code &__ec) noexceptvoid create_symlink (const path &__to, const path &__new_symlink)void create_symlink (const path &__to, const path &__new_symlink, error_code &__ec) noexceptpath current_path ()void current_path (const path &__p)void current_path (const path &__p, error_code &__ec) noexceptpath current_path (error_code &__ec)bool equivalent (const path &__p1, const path &__p2)bool equivalent (const path &__p1, const path &__p2, error_code &__ec) noexceptbool exists (const path &__p)bool exists (const path &__p, error_code &__ec) noexceptbool exists (file_status) noexceptuintmax_t file_size (const path &)uintmax_t file_size (const path &, error_code &) noexceptuintmax_t hard_link_count (const path &)uintmax_t hard_link_count (const path &, error_code &) noexceptsize_t hash_value (const path &__p) noexceptbool is_block_file (const path &__p)bool is_block_file (const path &__p, error_code &__ec) noexceptbool is_block_file (file_status __s) noexceptbool is_character_file (const path &__p)bool is_character_file (const path &__p, error_code &__ec) noexceptbool is_character_file (file_status __s) noexceptbool is_directory (const path &__p)bool is_directory (const path &__p, error_code &__ec) noexceptbool is_directory (file_status __s) noexceptbool is_empty (const path &__p)bool is_empty (const path &__p, error_code &__ec)bool is_fifo (const path &__p)bool is_fifo (const path &__p, error_code &__ec) noexceptbool is_fifo (file_status __s) noexceptbool is_other (const path &__p)bool is_other (const path &__p, error_code &__ec) noexceptbool is_other (file_status) noexceptbool is_regular_file (const path &__p)bool is_regular_file (const path &__p, error_code &__ec) noexceptbool is_regular_file (file_status) noexceptbool is_socket (const path &__p)bool is_socket (const path &__p, error_code &__ec) noexceptbool is_socket (file_status __s) noexceptbool is_symlink (const path &__p)bool is_symlink (const path &__p, error_code &__ec) noexceptbool is_symlink (file_status) noexceptfile_time_type last_write_time (const path &)file_time_type last_write_time (const path &, error_code &) noexceptvoid last_write_time (const path &__p, file_time_type __new_time)void last_write_time (const path &__p, file_time_type __new_time, error_code &__ec) noexceptcopy_options & operator&= (copy_options &__x, copy_options __y) noexceptconstexpr copy_options operator^ (copy_options __x, copy_options __y) noexceptcopy_options & operator^= (copy_options &__x, copy_options __y) noexceptconstexpr copy_options operator| (copy_options __x, copy_options __y) noexceptcopy_options & operator|= (copy_options &__x, copy_options __y) noexceptconstexpr copy_options operator~ (copy_options __x) noexceptvoid permissions (const path &, perms, perm_options, error_code &) noexceptvoid permissions (const path &__p, perms __prms, error_code &__ec) noexceptvoid permissions (const path &__p, perms __prms, perm_options __opts=perm_options::replace)path proximate (const path &__p, const path &__base, error_code &__ec)path proximate (const path &__p, const path &__base=current_path())path proximate (const path &__p, error_code &__ec)path read_symlink (const path &__p)path read_symlink (const path &__p, error_code &__ec)path relative (const path &__p, const path &__base, error_code &__ec)path relative (const path &__p, const path &__base=current_path())path relative (const path &__p, error_code &__ec)bool remove (const path &, error_code &) noexceptbool remove (const path &__p)uintmax_t remove_all (const path &)uintmax_t remove_all (const path &, error_code &)void rename (const path &__from, const path &__to)void rename (const path &__from, const path &__to, error_code &__ec) noexceptvoid resize_file (const path &__p, uintmax_t __size)void resize_file (const path &__p, uintmax_t __size, error_code &__ec) noexceptspace_info space (const path &__p)space_info space (const path &__p, error_code &__ec) noexceptfile_status status (const path &)file_status status (const path &, error_code &) noexceptbool status_known (file_status) noexceptvoid swap (path &__lhs, path &__rhs) noexceptfile_status symlink_status (const path &)file_status symlink_status (const path &, error_code &) noexceptpath temp_directory_path ()path temp_directory_path (error_code &__ec)template<typename _InputIterator, typename _Require = __detail::_Path2<_InputIterator>, typename _CharT = __detail::__value_type_is_char_or_char8_t<_InputIterator>> path u8path (_InputIterator __first, _InputIterator __last)template<typename _Source, typename _Require = __detail::_Path<_Source>, typename _CharT = __detail::__value_type_is_char_or_char8_t<_Source>> path u8path (const _Source &__source)path weakly_canonical (const path &__p)path weakly_canonical (const path &__p, error_code &__ec)
and then, like, a lil extra cluster of operator besties that showed up at the bottom of the function list π these are still functions, they just came in their own lil paragraph:
constexpr perms operator| (perms __x, perms __y) noexceptconstexpr perms operator^ (perms __x, perms __y) noexceptconstexpr perms operator~ (perms __x) noexceptperms & operator&= (perms &__x, perms __y) noexceptperms & operator|= (perms &__x, perms __y) noexceptperms & operator^= (perms &__x, perms __y) noexcept
and another lil cluster for perm_options:
constexpr perm_options operator| (perm_options __x, perm_options __y) noexceptconstexpr perm_options operator^ (perm_options __x, perm_options __y) noexceptconstexpr perm_options operator~ (perm_options __x) noexceptperm_options & operator&= (perm_options &__x, perm_options __y) noexceptperm_options & operator|= (perm_options &__x, perm_options __y) noexceptperm_options & operator^= (perm_options &__x, perm_options __y) noexcept
and a third lil cluster for directory_options:
constexpr directory_options operator| (directory_options __x, directory_options __y) noexceptconstexpr directory_options operator^ (directory_options __x, directory_options __y) noexceptconstexpr directory_options operator~ (directory_options __x) noexceptdirectory_options & operator&= (directory_options &__x, directory_options __y) noexceptdirectory_options & operator|= (directory_options &__x, directory_options __y) noexceptdirectory_options & operator^= (directory_options &__x, directory_options __y) noexcept
π₯ Detailed Description π₯
ISO C++ 2017 namespace for File System library.
that's the whole detailed description bestie. it's giving "minimalist". it's giving "the synopsis ate and left no crumbs". periodt π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
like, no human author, just Doxygen doing its lil automated thing and honestly? respect the hustle π€β¨
and that's the page!! this whole thing comes to you from libstdc++, and yeah the footer is just libstdc++ repping itself with std::filesystem(3) β no date on this one, so no birthday to celebrate, but every day is a good day to read a manpage fr fr. go touch some files, bestie, you've got this π«Άπ
π¦ 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