in reply to Re: Searching in binary files
in thread Searching in binary files

Sorry zentra, I don't quite follow. What's the advantage in searching for several smaller bits in the buffer over searching for one bigger bit?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: Searching in binary files
by zentara (Cardinal) on Dec 15, 2005 at 12:54 UTC
    The advantage is that the regex you are running over the sliding binary chunks will be smaller, and (I think) therefore faster. So I figured it would be more efficient on big files. If it's a really big file, most chunks won't match, so why test a regex string of length 1000, when a test on length 250 will give a quick "sniff", indicating whether you should dig deeper at that general area.

    But as always, I defer to your greater experience and wisdom. :-)


    I'm not really a human, but I play one on earth. flash japh
      But as always, I defer to your greater experience and wisdom. :-)

      All I've got in abundance is age!


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.