Error Handling & File Races
Let's briefly discuss how errors are handled in std:filesystem library.
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 1300+ tech skills courses.