slight generalization of the temporary file support