Creates that directory, or a directory under this one.

        ``path.mkdir(name)`` is a shortcut for ``(path/name).mkdir()``.

        :param name: Path component to append to this path before creating the
            directory.

        :param parents: If True, missing directories leading to the path will
            be created too, recursively. If False (the default), the parent of
            that path needs to exist already.

        :param mode: Permissions associated with the directory on creation,
            without race conditions.

def mkdir(self, name=None, parents=False, mode=0o777):
        """Creates that directory, or a directory under this one.

        ``path.mkdir(name)`` is a shortcut for ``(path/name).mkdir()``.

        :param name: Path component to append to this path before creating the
            directory.

        :param parents: If True, missing directories leading to the path will
            be created too, recursively. If False (the default), the parent of
            that path needs to exist already.

        :param mode: Permissions associated with the directory on creation,
            without race conditions.
        """
        if name is not None:
            return (self / name).mkdir(parents=parents, mode=mode)
        if self.exists():
            return
        if parents:
            os.makedirs(self.path, mode)
        else:
            os.mkdir(self.path, mode)
        return self