[tor-commits] [torouter/master] Write to /var/tmp/tor-tui
hellais at torproject.org
hellais at torproject.org
Fri Aug 19 13:59:24 UTC 2011
commit 2ec2f16558d474ba517d9a2ce337a79c3be55a9d
Author: Arturo FilastoÌ <hellais at torproject.org>
Date: Fri Aug 19 15:59:04 2011 +0200
Write to /var/tmp/tor-tui
---
packages/torouter-web/src/tui/utils/fileio.py | 5 ++++-
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')
More information about the tor-commits
mailing list