test write_file.