Copy contents of file and close without saving