Advanced Programming in the
UNIX Environment

by W. Richard Stevens
Addison-Wesley Professional Computing Series
0-201-56317-7 * Hardcover * 768 pages * ©1992
[Buy this book]

Chapter 5. Standard I/O Library

Introduction * Streams and FILE Objects * Standard Input, Standard Output, and Standard Error * Buffering * Opening a Stream * Reading and Writing a Stream * Line-at-a-Time I/O * Standard I/O Efficiency * Binary I/O * Positioning a Stream * Formatted I/O * Implementation Details * Temporary Files * Alternatives to Standard I/O * Summary

Example Relevant Functions
5.1 Copy standard input to standard output (using getc/putc) getc, putc, ferror
5.2 Copy standard input to standard output (using fgets/fputs) fgets, fputs, ferror
5.3 Print buffering type (none/line/full) + buffer sizes for stdin/stdout/stderr/file getc, getchar, fopen, fputs,
5.4 Create temporary files tmpnam, tmpfile, fgets, rewind, fputs
5.5 Usage of tempnam (not tmpnam) for temporary file names tempnam

[Buy this book]