Chapter 10: Using the File System

The purpose of the STL filesystem library is to normalize file system operations across platforms. The filesystem library seeks to normalize operations, bridging irregularities between POSIX/Unix, Windows, and other file systems.

The filesystem library was adopted from the corresponding Boost library and incorporated into the STL with C++17. At the time of writing, there are still gaps in its implementation on some systems, but the recipes in this chapter have been tested on Linux, Windows, and macOS file systems, and compiled with the latest available versions of the GCC, MSVC, and Clang compilers, respectively.

The library uses the <filesystem> header, and the std::filesystem namespace is commonly aliased ...

Get C++20 STL Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.