From: Adriana Draghici Date: Sat, 17 Apr 2010 11:30:25 +0000 (+0000) Subject: autorun: changed path for sessions info file. X-Git-Tag: getopt_long~65 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=fcb4ba606c949b799eb295f43a38fce82db694e5;p=cs-p2p-next.git autorun: changed path for sessions info file. --- diff --git a/autorun/Util.py b/autorun/Util.py index bc00d66..0cbb4ed 100644 --- a/autorun/Util.py +++ b/autorun/Util.py @@ -6,7 +6,15 @@ SERVER_TYPE = "python" SERVER_PORT = 10004 SERVER_HOST = "172.16.20.3" -SESSIONS_FILE = "/home/p2p/sessions.txt" # TO CHANGE +import os +def get_sessions_file_path(): + dirpath = os.environ['HOME']+"/"+".autorun/" + if not os.path.exists(dirpath): + os.mkdir(dirpath) + path = dirpath +"sessions.txt" # FIND A BETTER NAME!!! + return path + +SESSIONS_FILE = get_sessions_file_path() BUFFER_SIZE = 4096 """ Message types: client -> server """