Actually write the file