allow recursive (-p) directory creation
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Thu, 4 Sep 2008 07:53:52 +0000 (07:53 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Thu, 4 Sep 2008 07:53:52 +0000 (07:53 +0000)
lib/python/Tools/Directories.py

index 576d277..8a35f1d 100644 (file)
@@ -126,9 +126,12 @@ def resolveFilename(scope, base = "", path_prefix = None):
 def pathExists(path):
        return os_path.exists(path)
 
 def pathExists(path):
        return os_path.exists(path)
 
-def createDir(path):
+def createDir(path, makeParents = False):
        try:
        try:
-               mkdir(path)
+               if makeParents:
+                       makedirs(path)
+               else:
+                       mkdir(path)
        except:
                ret = 0
        else:
        except:
                ret = 0
        else: