ReadList
- To: mathgroup at smc.vnet.net
- Subject: [mg20732] ReadList
- From: Andrew Watson <abwatson at mail.arc.nasa.gov>
- Date: Wed, 10 Nov 1999 00:17:46 -0500
- References: <199911080748.CAA13701@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Consider the following oddity: In[82]:= WriteBinary["tmp", {10, 13}, ByteConversion -> Identity]; Close["tmp"]; In[84]:= ReadListBinary["tmp", Byte] Out[84]= {10, 13} In[85]:= ReadList["tmp", Byte] Out[85]= {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. Regards, Andrew Watson
- References:
- RE: Congratulations MathGroup!
- From: "Barthelet, Luc" <lucb@ea.com>
- RE: Congratulations MathGroup!