Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

ReadListBinary -- Is this a bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17947] ReadListBinary -- Is this a bug?
  • From: Virgil Stokes <virgil.stokes at neuro.ki.se>
  • Date: Sat, 5 Jun 1999 02:56:11 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

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?