MathGroup Archive 1996

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

Search the Archive

Re: Problem reading binary files - news26.txt [1/1]

  • To: mathgroup at
  • Subject: [mg3339] Re: Problem reading binary files - news26.txt [1/1]
  • From: ianc (Ian Collier)
  • Date: Wed, 28 Feb 1996 03:36:15 -0500
  • Organization: Wolfram Research, Inc.
  • Sender: owner-wri-mathgroup at

In article <4gp4o5$m1c at>, peter at (Peter
Weijnnitz) wrote:

> I am using Mathematica 2.2.1 for windows 3.1 and I have found a problem 
> when reading binary files, e.g. ReadList["bin.raw",{<<listofByte>>}]
> where bin.raw is a file of size Length[listofByte].
> It seems that the problem occures when ReadList finds a binary sequence 
> coerresponding to decimal 26 (ascii=^z SUB) this sequence Mathematica
interprets as a 
> EndOfFile and the rest of the file is not read in (the rest of
listofByte is filled with
> EndOfFile ). What is the cure for this?
> I have tried: 
> 1 Mathematica ver. 2.2.3
> 2 reading characters instead
> 3 using the package BinaryFiles
> with the same result
> Peter W

You will need to use Todd Gayley's FastBinaryFiles program 
that is available on MathSource, Wolfram Research's electronic
library of Mathematica materials. Here are the details:

0206-783: FastBinaryFiles: A MathLink Program for Fast Reading and 
Writing of Binary Files 

Todd Gayley

FastBinaryFiles is a MathLink program and Mathematica package 
for fast reading and writing of binary files. It is intended 
as a replacement for the standard package Utilities`BinaryFiles`, 
which is slow and cannot be used under MS Windows. A ready-to-
run executable is available for Mac and Windows; others will 
have to build the program from the single source file, 
Note that there is no separate package (.m) file. If you want to 
use the program on Mac or Windows, the executable is all you need. 
If you want to compile it on your own, the C source file 
is all you need. You need Mathematica version 2.2 or later to use
FastBinaryFiles (I haven't tried it with v2.1, but it might work). 
DOS users cannot use it, as MathLink is not available for DOS, 
and Windows users need either version 2.2.2, or 2.2.1 and the 
MathLink Developer's Kit for Windows. This program is discussed 
more fully in Volume 4, Issue 2 of The Mathematica Journal.

MathSource is accessible by email (mathsource at, 
by anonymous ftp/gopher ( and by 
World Wide Web (

I hope this helps.


Ian Collier
Wolfram Research, Inc.
tel:(217) 398-0700   fax:(217) 398-0747    ianc at
Wolfram Research Home Page:


  • Prev by Date: Re: Constant term in polynomial?
  • Next by Date: Curve Fitting Question can you help?
  • Previous by thread: Problem reading binary files - news26.txt [1/1]
  • Next by thread: Constant term in polynomial?