Reads in only part of file
- To: mathgroup at smc.vnet.net
- Subject: [mg51155] Reads in only part of file
- From: Steve Gray <stevebg at adelphia.net>
- Date: Wed, 6 Oct 2004 04:34:50 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I have a binary file of 945 coordinates, in X,Y pairs, each value being 8 bits, for 1890
bytes total. I have examined the file with a hex file display and editor (which shows the file as 2
hex characters per byte) and confirms that the file contains exactly the expected number of bytes.
My input process is:
roswin[nv_]:= Module[{st1},
nverts = nv;
st1="D:\Math\Geometry\Combinatorial Geom\Oswin\Otypes\otypes07.b08";
Print["Reading file: ",st1];
xin=ReadList[st1,{Byte,Byte}];
]
The file opens ok but the input list xin contains only 230 coordinate pairs (byte pairs) instead of
945. The values that do read in are correct. The {Byte,Byte} seems to be the only data type that
works here. Can anyone suggest what I am doing wrong? (Do I have to Close st1?) Thank you for any
tips.
Steve Gray