def METHOD_NAME(self, path, pattern, recursive):
    # Currently only supports a single "*" pattern.
    n_wildcards = pattern.count("*")
    n_single_wildcards = pattern.count("?")
    if n_single_wildcards:
        raise NotImplementedError("? single wildcards not implemented.")
    if n_wildcards == 0:
        raise ValueError
    elif n_wildcards > 1:
        raise NotImplementedError("Multiple * wildcards not implemented.")
    prefix, suffix = pattern.split("*")
    for name, mode, *_ in os.ilistdir(path):
        full_path = path + _SEP + name
        if name.startswith(prefix) and name.endswith(suffix):
            yield full_path
        if recursive and mode & 0x4000:  # is_dir
            yield from self.METHOD_NAME(full_path, pattern, recursive=recursive)