In this chapter, we learned how to open a file in different ways, depending on how we plan to use the file itself. Once opened, we learned how to read and write to the file using the std::fstream C++ APIs.
We learned the difference between fields and bytes, and the advantages and disadvantages of both methods of reading and writing, as well as common unsafe practices. In addition, we learned about support functions that provide the ability to move pointers within the std::fstream APIs to manipulate how a file is read and written.
Furthermore, in this chapter, we gave an extensive overview of the new filesystem APIs added to C++17, including paths and their support functions for manipulating files and directories.
We concluded this chapter with three examples. In the first we wrote a logger to redirect the output of std::clog to a log file and stdout. The second example...