MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

ReadListBinary -- Is this a bug?


The following Mathematica code when
using Mathematica 3.0 produces unexpected results.

  <<Utilities`BinaryFiles`;
  Remove[data,stream];

  data = Table[n,{n,10,100}]

  stream = OpenWriteBinary["TestFile"]

  WriteBinary[stream,data,ByteConversion->Identity]
  WriteBinary[stream,data,ByteConversion->Identity]
  Close[stream];

  stream = OpenReadBinary["TestFile"];
  SetStreamPosition[stream,20];
  data = ReadListBinary[stream,Byte,20]

  StreamPosition[stream]
  SetStreamPosition[stream,0];

  kk = 20;
  data  = ReadListBinary[stream,Byte,kk] (* why doesn't this work? *)
  data = ReadListBinary[stream,Byte,20] (* while this works as expected *)
  SetStreamPosition[stream,0];
  data = ReadListBinary[stream,Byte]

  Close[stream]

What is puzzling is that the above ReadlListBinary[stream,Byte,kk]
does not execute as I would expect. It seems that the number of instances
parameter
for the ReadListBinary can not be symbolic -- why?.

-- Virgil




  • Prev by Date: Precision
  • Next by Date: Early Results from Mathematica 4.0
  • Previous by thread: Precision
  • Next by thread: Re: ReadListBinary -- Is this a bug?