# HG changeset patch # User Nicholas Jillings # Date 1505842014 -10800 # Node ID 9a201c63a0ebcd995c888d440f44e48a0a820ead # Parent b09e9b7ef246e7e83b61665810e4c341fddec8c8 Implementation for #231 diff -r b09e9b7ef246 -r 9a201c63a0eb php/requestKey.php --- a/php/requestKey.php Thu Sep 14 13:14:00 2017 +0100 +++ b/php/requestKey.php Tue Sep 19 20:26:54 2017 +0300 @@ -11,6 +11,10 @@ return $randomString; } +if (!file_exists("../saves")) { + mkdir("../saves"); +} + // Request a new session key from the server header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); diff -r b09e9b7ef246 -r 9a201c63a0eb python/pythonServer.py --- a/python/pythonServer.py Thu Sep 14 13:14:00 2017 +0100 +++ b/python/pythonServer.py Tue Sep 19 20:26:54 2017 +0300 @@ -13,6 +13,7 @@ import copy import string import random +import errno if sys.version_info[0] == 2: # Version 2.x @@ -28,6 +29,12 @@ scriptdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # script directory os.chdir(scriptdir) # does this work? +try: + os.makedirs("../saves") +except OSError as e: + if e.errno != errno.EEXIST: + raise + PSEUDO_PATH = '../tests/' pseudo_files = [] pseudo_index = 0