Go Back   Velocity Reviews > Newsgroups > Python
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Python - Temp dir creation

 
Thread Tools Search this Thread
Old 03-24-2005, 03:10 AM   #1
Default Temp dir creation



I'm a bit puzzled by the following behaviour
(at least in the way I read
http://docs.python.org/lib/module-tempfile.html )

> python

Python 2.4 (#1, Mar 21 2005, 23:04:52)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tfile = tempfile.mkstemp('','','.')
>>> tfile

(3, '/home/local/9qF7kf')

OK, it works as expected, but...

>>> tdir = tempfile.mkdtemp('','','.')
>>> tdir

'./HFXmX2'

I thought this should be '/home/local/HFXmX2'?
According to the doc page above "mkdtemp() returns
the absolute pathname of the new directory", which
isn't what I get:

>>> os.path.abspath(tdir)

'/home/local/HFXmX2'

Workaround I'm using:

>>> import os
>>> tdir = tempfile.mkdtemp('','',os.path.abspath('.'))
>>> tdir

'/home/local/5r8gFi'
>>>


Comments?

Cheers!

--

Gunnm: Broken Angel http://amv.reimeika.ca
http://reimeika.ca/ http://photo.reimeika.ca


marco
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem logging into eBay after deleting all contents of Temp Folder - Help Needed! ruddy2000 General Help Related Topics 0 11-15-2006 12:30 PM
Re: AMD 3500+ temp question eveversion4 A+ Certification 0 10-16-2006 05:35 AM
Re: @ Deleting the content of Temp Folder? MF A+ Certification 0 01-06-2006 04:36 AM
Re: @ Deleting the content of Temp Folder? Gary A+ Certification 3 01-04-2006 05:58 PM
deleting temp problem -D- A+ Certification 6 11-13-2003 12:37 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46