MathGroup Archive 1999

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

Search the Archive


  • To: mathgroup at
  • Subject: [mg20732] ReadList
  • From: Andrew Watson <abwatson at>
  • Date: Wed, 10 Nov 1999 00:17:46 -0500
  • References: <>
  • Sender: owner-wri-mathgroup at

Consider the following oddity:

WriteBinary["tmp", {10, 13}, ByteConversion -> Identity];

ReadListBinary["tmp", Byte]

{10, 13}

ReadList["tmp", Byte]

{13, 10}

Why does ReadList invert the roles of 10 and 13? I gather this has 
something to do with carriage returns and line feeds, but if one is 
specifying Byte as the type for ReadList, then one expects the byte 
that is in the file. Examination with a hex dump program will reveal, 
of course, that the contents of the file are indeed {10,13}.

Whatever the tortured explanation, what is a body to do? The 
ReadListBinary function is about 200 times slower than ReadList and 
thus unusable, and the MathSource package FastBinaryFiles is 
non-standard and difficult to install. It seems bizarre that this 
capability (reading raw bytes rapidly from a file) is not readily 
available, especially since it is presumably required by the built-in 
Import function.

Andrew Watson

  • Prev by Date: Re: Re: Combinatorica questions!!!
  • Next by Date: Re: Simplifying Matrix Product.. a partial answer??
  • Previous by thread: RE: Congratulations MathGroup!
  • Next by thread: Erasing a Plot?