cmd > outfile
is done?
// prog > afile < bfile fork() // in the child process close(STDOUT_FILENO); open afile close (STDIN_FILENO); open bfile exec prog
off_t lseek(int fd, off_t offset, int whence);
SEEK_SET
move to the value of offset. (absolute seek)
SEEK_CUR
move to the current position + offset
SEEK_END
move to the end of the file + offset
SEEK_DATA
: find the next position >= offset that contains data.
SEEK_HOLE
: find the next position >= offset that contains a hole.