'mkdir(path, mode=None)
Creates a directory and any parent directory if necessary.'

def mkdir(self, path, mode=None):

    path = Hdfs.normpath(path)
    params = self._getparams()
    params['op'] = 'MKDIRS'
    if (mode is None):
        mode = self.getDefaultDirPerms()
    params['permission'] = safe_octal(mode)
    success = self._root.put(path, params)
    if (not success):
        raise IOError((_('Mkdir    failed:    %s') % path))
