in reply to Re^3: How to read number of block in binary files?
in thread How to read number of block in binary files?
Hi.. Thank for your info.. that very helpful.. But could you guide me how could i read the binary files until end of file ?..
This is my latest code:-
if ($fname) { open (OUTPUT, ">$fname.tmp") or die "Can't open $fname.tmp $!\ +n"; open (DATA, "<$fname") or die "Can't open $fname $!\n"; binmode DATA; read(DATA, $data, BLOCKHDR); $blockhdr = unpack "H*", $data; read(DATA, $data, BLOCKDATA); $blockdt = unpack "H*", $data; my $t_cdr = hextoint(reverse_str(substr($blockdt,4))); my $blocklen = $t_cdr * 286; read(DATA, $data, $blocklen); my $record = unpack "H*", $data; close(DATA); close(OUTPUT); } else {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to read number of block in binary files?
by jwkrahn (Abbot) on Mar 10, 2009 at 10:24 UTC |