T
Tex
I have a program that reads a binary data file in Unix and works just
fine, however when I tried it in Linux the read and unpack commands did
not give me the same answer. I am trying to simply read a short
integer. In Unix, the $nscan is around 20000, in linux it is a huge
number or even negative. I belive that the problem has to do with
bigendian vs littleendian, but when I try different combinations of
unpack options nothing works.
Thanks
tex
open(F, "$filein") or die "Unable to open file";
binmode(F);
read(F,$packscans, 4);
$nscan = unpack("i*",$packscans);
fine, however when I tried it in Linux the read and unpack commands did
not give me the same answer. I am trying to simply read a short
integer. In Unix, the $nscan is around 20000, in linux it is a huge
number or even negative. I belive that the problem has to do with
bigendian vs littleendian, but when I try different combinations of
unpack options nothing works.
Thanks
tex
open(F, "$filein") or die "Unable to open file";
binmode(F);
read(F,$packscans, 4);
$nscan = unpack("i*",$packscans);