Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Read Binarys Problem and Linux
June 15, 2005, 11:04 am
rate this thread
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.
open(F, "$filein") or die "Unable to open file";
$nscan = unpack("i*",$packscans);
Re: Read Binarys Problem and Linux
Can you post the output of 'dd if=<file> bs=4 count=1 | OD -TXc'?
WRT endianness: what is the processor of the Unix box and what is Linux
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett