in reply to Reading binary file is not accurate ?
BLOCKLEN (1531) = BLOCKHDR(14) + MAXRECORD(9) * CDRLEN(160) + BLOCKTRL(77), but ...
# Read Block while (read (DATA, $data, BLOCKLEN)) { # Read Block Header read (DATA, $data, BLOCKHDR);
You read the whole block into $data and then attempt to read the individual parts, promptly overwriting (and therefore discarding) $data.
You should either:
Not do both!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading binary file is not accurate ?
by bh_perl (Monk) on May 03, 2010 at 03:18 UTC | |
by BrowserUk (Patriarch) on May 03, 2010 at 11:49 UTC | |
by Anonymous Monk on May 04, 2010 at 02:42 UTC | |
by BrowserUk (Patriarch) on May 04, 2010 at 04:14 UTC |