def createFolder(segments, recursive):
    """
        Create a folder at the path specified by segments.

        If `recursive` is True it will try to create parent folder.
        If `recursive` is False and parent folder does not exists it will
        raise `OSError`.
        """
