def mkdir(self):
        "write a directory for the node"
        if getattr(self, 'cache_isdir', None):
            return

        self.parent.mkdir()

        if self.name:
            try:
                os.mkdir(self.abspath())
            except __HOLE__:
                e = extract_exception()
                if e.errno != errno.EEXIST:
                    raise

            if not os.path.isdir(self.abspath()):
                raise IOError('%s is not a directory' % self)

            try:
                self.children
            except:
                self.children = {}

        self.cache_isdir = True
dataset/ETHPy150Open cournape/Bento/bento/core/node.py/Node.mkdir