[IronPython] array.fromfile

J. Merrill jvm_cop at spamcop.net
Sat Feb 24 15:39:57 CET 2007

At 04:14 PM 2/23/2007, JoeSox wrote (in part)
>On 2/23/07, Dino Viehland <dinov at exchange.microsoft.com> wrote:
>> Is there an issue w/ switching to using the I type for the array instead of the L type?
>I tried this but was unsuccessful.  It still results in the same
>exception being thrown.  If I am understanding everything, the only
>typecode that uses 8 bytes is floating point 'd'.

The file's size in bytes must be (at least) the number of values being read times the size of each value.  If you are giving the file size in bytes as the length of the array, that will not work.

What information do you have about the format of the file?  Are the values supposed to be 4-byte integers?  If so, you should divide the file size in bytes by 4 and use the I type, and look at the data to see if it makes any sense.

Good luck

J. Merrill / Analytical Software Corp

More information about the Ironpython-users mailing list