def find(self):
        lastbuf = ""
        while 0 < self._fp.tell():
            buf = self._read()
            bufpos = (buf + lastbuf).rfind(self._needle)
            if bufpos > -1:
                filepos = self._fp.tell() + bufpos
                self._fp.seek(filepos)
                return filepos

            # for it to work when the needle is split between chunks.
            lastbuf = buf[:len(self._needle)]

        return -1
Returns the position of the first occurence of needle.
dataset/ETHPy150Open Jahaja/psdash/psdash/log.py/ReverseFileSearcher.find