English
Topic 15. I/O streams, working with text and binary files, the std::filesystem library
Goal: learn to check file operations, describe formats, work with stream positions, and handle filesystem errors without losing data.
Lecture contents
- Streams and their states — A stream as a sequence of operations · States: good, eof, fail, and bad · Opening, modes, and lifetime
- Text and binary files — A text format and parsing the whole line · Formatting does not change the value · Text versus binary bytes · Random access to training records
- std::filesystem — A path is a structure, not a string with slashes · UTF-8: contents and file names · Traversing a tree and handling errors · Writing to a temporary file and publishing it · Checking the format and failures