Error Handling & File Races

Let's briefly discuss how errors are handled in std:filesystem library.

We'll cover the following

So far the examples in this chapter used exception handling as a way to report errors. The filesystem API is also equipped with function and method overloads that outputs an error code.

You can decide if you want exceptions or error codes.

For example, we have two overloads for file_size:

Get hands-on with 1200+ tech skills courses.