Always use temp file
Exit immediately if temp file not modified
Extract create_tmpfile()