Add makeDirectory.

develop
Mike Hiretsky 13 years ago
parent f6b2f750b3
commit d28e3a1457

@ -1364,3 +1364,19 @@ def getSupportArch():
return ['i686','x86_64']
else:
return ['i686']
def makeDirectory(pathname):
"""Make directory and parent.
If directory exists then return False else True"""
try:
parent = path.split(path.normpath(pathname))[0]
if not path.exists(parent):
makeDirectory(parent)
else:
if path.exists(pathname):
return False
os.mkdir(pathname)
return True
except Exception, e:
return False

Loading…
Cancel
Save