Write output to files.