The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: binary file i/o
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Harald Berndt

Posts: 24
Registered: 12/7/04
Re: binary file i/o
Posted: Aug 16, 1996 2:59 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

William Weglinski wrote:
> I am having difficulty reading and writing binary files correctly, With Mathematica 2.2
> for Windows on my PC. The first problem is that if a file contains the byte: 1A (i.e.
> hexadecimal 26), it is interpreted as EndOfFile, and I can't figure out any way to force
> Mathematica to read any more bytes after that. The second problem is trying to write
> the byte 0A (i.e. hexadecimal 10 -- a.k.a. linefeed ) to a file. Instead of writing
> just the byte: 0A, the bytes: 0D0A are outputted (carriage return+linefeed). Again, I
> can't find any way to override this behavior. The standard Mathematica package:
> Utilities`BinaryFiles` was of no help to me, nor could I make it work using the
> WriteString[] command directly. Setting the StringConversion option on the outputstream
> didn't work either. Has anyone else encountered this problem, and what can be done to
> work around it?

In order to work with binary files on DOS systems, you'll need to use
MathLink and Todd Gayley's package FastBinaryFiles.m (from
MathSource). It's the only way right now. I believe that Mma fo Win
2.2.3 finally supported MathLink. (Personally, I switched to the Mac
for just that reason: to read DOS binary files into Mma).

Harald Berndt University of California
Research Specialist Forest Products Laboratory
Phone: 510-215-4224 FAX:510-215-4299

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.