def mkdir(patch, path, mode=0o777):
    """
	Create a directory named path with numeric mode mode.
	The default mode is 0777 (octal). On some systems, mode is ignored.
	Where it is used, the current umask value is first masked out.
	If the directory already exists, OSError is raised.
	"""
    ap = os.path.abspath(os.path.join(CWD, path))
    manager = get_manager()
    fsi, relpath, readonly = manager.get_fsi(ap)
    if fsi is None:
        return _org_mkdir(relpath, mode)
    elif readonly:
        raise IOError("[Errno 1] Operation not permitted: '{p}'".format(p=ap))
    else:
        # FSI.mkdir() doesnt have a 'mode' argument, we need to ignore this
        try:
            return fsi.mkdir(relpath)
        except OperationFailure as e:
            raise os.error(e.message)

	Create a directory named path with numeric mode mode.
	The default mode is 0777 (octal). On some systems, mode is ignored.
	Where it is used, the current umask value is first masked out.
	If the directory already exists, OSError is raised.
	
lib/mlpatches/mount_base.py