Write to output file.