def ed_find(filename, search_str):
    """
    finds string search_str in the file named by filename and returns a
    list with index positions in the file text where the string search_str is located. E.g. it returns [4, 100]
    if the string was found at positions 4 and 100. It returns [] if the string was not found.
    :type filename: str
    :param filename: file to be searched
    :param search_str: string to search
    :return: list of indexes found
    """
    try:
        search_indexes = []
        with open(filename, mode='r', encoding="utf8") as file:
            contents = file.read()
            f_length = len(contents)
            search_len = len(search_str)
            current_index = 0
            while current_index + search_len < f_length:
                result = contents.find(search_str, current_index)
                if result != -1:
                    search_indexes.append(result)
                    current_index = result + search_len
                else:
                    break
        return search_indexes
    except OSError:
        return