Write to file.