X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Fmisc.py;h=f4168ee8827d1b8d1cfa6db2b311608c566f4bfc;hp=6b24e1bda62a670e4965de5c8a84b0d4df35aa98;hb=41a4d11fc1fa4d9aa801c879c7464bd0de6defcc;hpb=17cacdad0adc9cebcb21f0f3a138192008f3aeaa diff --git a/mudpy/misc.py b/mudpy/misc.py index 6b24e1b..f4168ee 100644 --- a/mudpy/misc.py +++ b/mudpy/misc.py @@ -1,8 +1,8 @@ """Miscellaneous functions for the mudpy engine.""" -# Copyright (c) 2004-2018 Jeremy Stanley . Permission -# to use, copy, modify, and distribute this software is granted under -# terms provided in the LICENSE file distributed with this software. +# Copyright (c) 2004-2018 mudpy authors. Permission to use, copy, +# modify, and distribute this software is granted under terms +# provided in the LICENSE file distributed with this software. import codecs import os @@ -994,6 +994,7 @@ def log(message, level=0): if file_name: if not os.path.isabs(file_name): file_name = os.path.join(universe.startdir, file_name) + os.makedirs(os.path.dirname(file_name), exist_ok=True) file_descriptor = codecs.open(file_name, "a", "utf-8") for line in lines: file_descriptor.write(timestamp + " " + line + "\n") @@ -2389,6 +2390,7 @@ def create_pidfile(universe): if file_name: if not os.path.isabs(file_name): file_name = os.path.join(universe.startdir, file_name) + os.makedirs(os.path.dirname(file_name), exist_ok=True) file_descriptor = codecs.open(file_name, "w", "utf-8") file_descriptor.write(pid + "\n") file_descriptor.flush()