Staging
v0.5.1
https://github.com/python/cpython
Revision e9a92aa03ac91c307a90db8eefff22cea1b97399 authored by Jeremy Hylton on 17 July 2003, 14:41:07 UTC, committed by Jeremy Hylton on 17 July 2003, 14:41:07 UTC
I tested against VC 7.0 and it caused no problems there.
1 parent de7cdb2
Raw File
Tip revision: e9a92aa03ac91c307a90db8eefff22cea1b97399 authored by Jeremy Hylton on 17 July 2003, 14:41:07 UTC
Patch from John Anderson to enable VC 7.1 support.
Tip revision: e9a92aa
makedir.py
#! /usr/bin/env python

# Like mkdir, but also make intermediate directories if necessary.
# It is not an error if the given directory already exists (as long
# as it is a directory).
# Errors are not treated specially -- you just get a Python exception.

import sys, os

def main():
	for p in sys.argv[1:]:
		makedirs(p)

def makedirs(p):
	if p and not os.path.isdir(p):
		head, tail = os.path.split(p)
		makedirs(head)
		os.mkdir(p, 0777)

main()
back to top