get the new file and write it