What are the best ways to search a binary file for a specific sequence of
hex values?  The sequence that I'm looking for is: FF D8 FF E0 00 10 4A 46
49 46 00.  The files that I'm searching are 14K bytes in size.  I suppose
the easiest way would be slurp the whole file in at once and then search for
my sequence in some string variable.  But what if my files were huge?  Do I
read in one character at a time until I find an FF and then I look for the
D8 and then the rest of the hex values resetting my search if I fail to find
the next value in the sequence?  Or do I read in 1K of data at a time and
search that for my sequence?  Could some of you who have been down this road
before point me in the right direction?  I'm not asking you to write my code
for me (unless you want to).  I'm just looking for pointers and suggestions.

Thanks!

Thad Schultz
EDA Librarian / Sys Admin
Woodward Industrial Controls 
[EMAIL PROTECTED]
ph (970)498-3570
fax (970)498-3077
www.woodward.com



***
The information in this e-mail is confidential and intended solely for the
individual or entity to whom it is addressed. If you have received this
e-mail in error please notify the sender by return e-mail, delete this
e-mail, and refrain from any disclosure or action based on the information.
****
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to