Writing results to files.