C & Unix

File I/O in C: Text, Binary and Positioning

7:52

Plays from YouTube. Watch on YouTube

What is the difference between reading a line and reading a fixed number of binary bytes?

Meet File I/O in C: Text, Binary and Positioning: an original animated lesson in C and Unix systems programming.

We start with fopen, fread, fwrite, their returned element counts and the lifecycle of a FILE stream.

Then we trace fgets, file position, seeking, EOF/error indicators, buffering and portable on-disk formats.

The big idea: Reliable file I/O accounts for positioning, representation and the exact amount transferred.

C and Unix explained visually, one concept at a time.