reopen_tempfile(): truncate opened file