Reversing the contents of the file using only UNIX system calls