I am trying to read a binary with the following code:
open(F, "<$file") || die "Can't read $file: $!\n";
binmode(F);
$data = <F>;
close F;
open (D,">debug.txt");
binmode(D);
print D $data;
close D;
Input file 16 M; debug.txt is only about 400 thousand. When I look at debug.txt in emacs, the last two characters are: ^ A ^ C (SOH and ETX characters, according to notepad ++), although the same pattern is present in debug.txt. The next line of the file has ^ O (SI) char, and I think the first occurrence of this particular character.
How can I read this whole file?
chris source
share