Search for a string in binary files

John Hunter jdhunter at ace.bsd.uchicago.edu
Tue Jul 22 10:10:49 EDT 2003


>>>>> "hokieghal99" == hokieghal99  <hokiegal99 at hotmail.com> writes:

    hokieghal99> And, would it be more efficent (faster) to just call
    hokieghal99> grep from python to do the searching?

Depending on how you call grep, probably.  If you respawn grep for
each file, it might be slower than the python solution.  If you first
build the file list of all the files you want to search and then call
grep on all the files simultaneously, it will likely be a good bit
faster.  But you will have to deal with issues like quoting spaces in
filenames, etc....

JDH





More information about the Python-list mailing list