Version without JavaScript, read-only: workshops, quizzes and running code are not available here. Full version · Catalogue · Sign in

Exercise sheet 5

Input and output

Predict what a program writes depending on whether its output goes to the terminal or to a file, write wc, tee and tail with read, write and lseek, follow shared file offsets, send integers through a pipe. Chapter 5.

All programs are compiled with gcc -std=c11 -Wall -Wextra -Werror -D_POSIX_C_SOURCE=200809L. We do not use <stdio.h> to read or write the data, only for error messages and for displaying results.