Last Updated: June 6, 2026
Before C++17, working with paths and directories meant using platform-specific APIs: POSIX (opendir, stat, unlink) on Linux and macOS, Win32 (FindFirstFile, CreateDirectory, DeleteFile) on Windows. The C++17 <filesystem> header changed that. It standardizes a single, portable API for paths, files, and directories. This chapter covers what's in it, how the path type works, the main operations (create, remove, copy, rename, iterate), and how error handling splits into throwing and non-throwing overloads.