Table of Contents

C++ Filesystem library

https://en.cppreference.com/w/cpp/filesystem

The Filesystem library provides facilities for performing operations on file systems and their components, such as paths, regular files, and directories.

The filesystem library was originally developed as boost.filesystem, was published as the technical specification ISO/IEC TS 18822:2015, and finally merged to ISO C++ as of C++17. The boost implementation is currently available on more compilers and platforms than the C++17 library.

The filesystem library facilities may be unavailable if a hierarchical file system is not accessible to the implementation, or if it does not provide the necessary capabilities. Some features may not be available if they are not supported by the underlying file system (e.g. the FAT filesystem lacks symbolic links and forbids multiple hardlinks). In those cases, errors must be reported.

The behavior is undefined if the calls to functions in this library introduce a file system race, that is, when multiple threads, processes, or computers interleave access and modification to the same object in a file system.

Library-wide definitions

:* directory: a file that acts as a container of directory entries, which identify other files (some of which may be other, nested directories). When discussing a particular file, the directory in which it appears as an entry is its parent directory. The parent directory can be represented by the relative pathname

C

See C Language or C++

Mathematics


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.



© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


. :* regular file: a directory entry that associates a name with an existing file (i.e. a hard link). If multiple hard links are supported, the file is removed after the last hard link to it is removed. :* symbolic link: a directory entry that associates a name with a path, which may or may not exist. :* other special file types: block, character, fifo, socket.

:* absolute path: a path that unambiguously identifies the location of a file. :* canonical path: an absolute path that includes no symlinks,

or

elements. :* relative path: a path that identifies the location of a file relative to some location on the file system. The special path names

(dot, “current directory”) and

(dot-dot, “parent directory”) are relative paths.

<!– including swap, hash_value, comparisons, /, «, », and u8path –>

<!– including begin,end –>

<!– including begin,end –>

<!– including system_complete –>

<!– including weakly_canonical –>

<!– including proximate –>

<!– including create_directories –>

<!– including create_directory_symlink –>

<!– including remove_all –>

<!– including symlink_status –>

Notes

Using this library may require additional compiler/linker options. GNU implementation prior to 9.1 requires linking with

and LLVM implementation prior to LLVM 9.0 requires linking with

.

See also