use buffer as the content of the newFile for diff