Combines clear_file and append_to_file into overwrite_file