|
|
Files - Intro |
|
File I/O is primary way of communicating outside of the program.
C provides methods for opening, reading, writing, closing, and querying files.
Two layers of file I/O are provided: low level operations use file descriptors and higher level operations use FILE pointers.
File descriptors provide ability to abstract I/O to sockets and pipes as well as files but we're not going to cover this.
FILE pointers are more prevalent when dealing with files which is the most common need in scientific programming.
C defines three FILE pointers for every program: stdin,
stdout, stderr which are declared in
stdio.h.