Lecture 5 code: File I/O.