read_range


The following program reads a range of bytes form a file and prints those bytes to stdout. It demonstrates the lseek system call. Additionally, the program uses my helper function mu_write_n to handle potential partial writes and write n bytes.

Note that this program does not check that the range is valid in any way (e.g., the start value can be negative, the range can exceed the file size, and so forth).

read_range.c


      
mu.h


      
mu.c


      
Makefile