Hi there. I'm trying to generate a brand new file with a unique name by using tempfile.mkstemp(). In conjunction I used os.fdopen() to get a wrapper around file properties (write & read methods, and so on...) but 'name' attribute does not contain the correct file name. Why?
>>> import os >>> import tempfile >>> fileno, name = tempfile.mkstemp(prefix='ftpd.', dir=os.getcwd()) >>> fd = os.fdopen(fileno, 'wb') >>> fd.name <fdopen> Moreover, I'd like to know if I'm doing fine. Does this approach avoid race conditions or other types of security problems? Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list