Searching a binary file

Bjorn Pettersen bjorn at roguewave.com
Tue Jul 25 11:52:38 EDT 2000


luthi at vaw.baug.ethz.NOSPAM.ch wrote:
> 
> Thank you for your reply. This is obvious, but it won't work on large files
> (exceeding memory). This is why I read the file in chunks and searched these
> chunks. How should I choose the size of these chunks?

Well, that depends on your memory <wink>. I've got 256Mb on my desktop,
so I tend not to worry about it ;-)

> Is there a speed issue using string.find() or the regular expression search()?

string.find() is faster (sometimes much faster).

-- bjorn




More information about the Python-list mailing list