aboutsummaryrefslogtreecommitdiffstats
path: root/packages/torouter-web/src/tui/utils
diff options
context:
space:
mode:
authorArturo FilastoĢ€ <hellais@torproject.org>2011-08-19 15:59:04 +0200
committerArturo FilastoĢ€ <hellais@torproject.org>2011-08-19 15:59:04 +0200
commit2ec2f16558d474ba517d9a2ce337a79c3be55a9d (patch)
tree2e864126010867658fa7a89ac915d84d54bd90d4 /packages/torouter-web/src/tui/utils
parent61ed2b6b5c7605a9faf4ad531d7dc3f1eb1b1f2d (diff)
downloadtorouter-2ec2f16558d474ba517d9a2ce337a79c3be55a9d.tar.gz
torouter-2ec2f16558d474ba517d9a2ce337a79c3be55a9d.zip
Write to /var/tmp/tor-tui
Diffstat (limited to 'packages/torouter-web/src/tui/utils')
-rw-r--r--packages/torouter-web/src/tui/utils/fileio.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/torouter-web/src/tui/utils/fileio.py b/packages/torouter-web/src/tui/utils/fileio.py
index aea5462..0675f3f 100644
--- a/packages/torouter-web/src/tui/utils/fileio.py
+++ b/packages/torouter-web/src/tui/utils/fileio.py
@@ -1,9 +1,12 @@
import os
def write(files):
+ tmp_dir = "/var/tmp/tor-tui"
tmpfiles = []
for file in files:
- tmpfile = "/var/tmp/" + file[0].split("/")[-1:][0] + ".tmp"
+ if not os.path.exists(tmp_dir):
+ os.mkdir(tmp_dir)
+ tmpfile = tmp_dir + file[0].split("/")[-1:][0] + ".tmp"
tmpfiles.append((tmpfile,file[0]))
# open the tmp file for write
f = open(tmpfile, 'w')