Subject: Re: trouble reading binary files (with STk)
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1998/10/15
Newsgroups: comp.lang.scheme
Message-ID: <704fo1$3uqeu@fido.engr.sgi.com>
Jason Karney  <jason@netgenics.com> wrote:
+---------------
| I am trying to read in a binary file using STk... using read-char
| (which I convert to an integer), until eof-object? returns true.
+---------------

I assume you're testing for "eof-object?" *BEFORE* converting to int, yes?

+---------------
| For some reason, I always get eof after 61 characters are read in, and I
| wondered if it has to do with the value of eof-object.
+---------------

It is not required that "eof-object" have a first-class "value" per se,
only that it be something that be tested by the "eof-object?" predicate.
(That's why you have to test it *before* converting to int.)

I just read a binary file with "read-char" in STk 3.1.1 [on FreeBSD]
with no trouble at all.


-Rob

[p.s. Apologies in advance: Email'd replies may get
a "vacation" bounce message while I'm on sabbatical...]

-----
Rob Warnock, 8L-855		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
2011 N. Shoreline Blvd.		FAX: 650-964-0811
Mountain View, CA  94043	PP-ASEL-IA