register_tempfile(): new function to handle an existing temporary file