Can anybody explain what exactly streams are, and how they relate to files?
In the context of the C Standard Library a stream is a generic interface for performing certain I/O operations. You can read from streams, write to streams, some streams are seekable. Opening a file as a stream is only one way to get a stream as an I/O interface for an application.
Other examples for I/O streams in C:
For further reading, have a look at these:
Let me quote:
For historical reasons, the type of the C data structure that represents a stream is called
FILErather than “stream”. Since most of the library functions deal with objects of type
FILE *, sometimes the term file pointer is also used to mean “stream”. This leads to unfortunate confusion over terminology in many books on C.