Introduction

Here's a brief look at what we'll tackle in this section

We'll cover the following

Filesystem

Since early versions, in the Standard Library, there was an option to work with files. Through streams - like fstream you can open files, read data, write bytes and perform many other operations. However, what was missing is an ability to work with the filesystem as a whole. For example, in C++14 you had to use some third party libraries to iterate over directories, compose paths, delete directories or read file permissions. Now, with C++17 we made a big step forward. We can now leveragestd::filesystem component!

In this chapter you’ll learn:

  • How std::filesystem got into the Standard
  • What are the basic types and operations
  • How you can work with the paths
  • How to handle errors in std::filesystem
  • How to iterate over a directory
  • How to create new directories and files

Let’s get started with the overview of filesystem.

Get hands-on with 1400+ tech skills courses.