How to find substring in file?
<p>How to find string in binary file using only read(1) ?
For example I want to found position of string 'abst' in file ( without load to memory ) ?
It's work but very primitive:</p>

<pre>
#!/usr/bin/python2
f = open("/tmp/rr", "rb")
f.seek(0)

cont = 1
while(cont):
    a1 = f.read(1)
    if a1 == 'a':
        a2 = f.read(1)
        if a2 == 'b':
            a3 = f.read(1)
            if a3 == 's':
                a4 = f.read(1)
                if a4 == 't':
                    found = True
                    cont = 0

</pre>
