A5.2: Writing to files