On 4/12/05, John W. Krahn <[EMAIL PROTECTED]> wrote:
<snip>
> I can see two problems right away.
<snip>
> > while (!eof) {
> 
> You need to specify the filehandle you are reading from.
> 
<snip>

A bare eof operates on the last filehandle read from. perldoc -f eof. 
The only place I'm going to get EOF from the OS here is IMG, and it
works as expected.

<snip>
> The second problem is that $eofsec contains multiple bytes and may (and
> probably does) overlap $sector boundaries.  The easy solution would be to read
> the entire file into a variable.

I thought about this, but everything I've read assumes that the files
begin on sector boudaries.  The code I borrowed from only eaxmined the
first 4 bytes of each read, and the regex works anchored at the
beginning of the string.  If I were only missing a few files, I'd say
this was it.  But I'm not picking up any.  All the EOFs can't be split
across boundaries, can they?  Or can they?  It's worth checking into
again.  I was hoping to avoid reading the entire image into memory,
though.

Thanks,

jay

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to