Chapter Overview

Let's get an idea of what we'll cover in this chapter.

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 as fs:

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy