On Nov 2, 2007, at 12:24 PM, Carlos Neves wrote: > Will os.tempnam() use this dir by default?
No, but it's bad security practice to use os.tempnam unless you really know what you're doing (at that point, you can pass in the target directory as the 'dir' keyword argument). Here's how to properly get a temporary file in Python until we provide helpers for it through Sugar: ---- import os.path import tempfile from os import environ tmp_root = os.path.join(environ['SUGAR_ACTIVITY_ROOT'], 'tmp') tmp = tempfile.TemporaryFile(dir=tmp_root) --- At this point, 'tmp' is a file-like object that you can use normally. -- Ivan Krstić <[EMAIL PROTECTED]> | http://radian.org _______________________________________________ Sugar mailing list [email protected] http://lists.laptop.org/listinfo/sugar

