write an given input string to a temp file on disk