pax@pax7300.att.com (11/10/90)
Icon Trekkies!
Is it possible that Version 8 of Icon on MS-DOS will not read past
an octal 32 with reads???
procedure main()
fd := open("TESTOFF.DBF","ru") | stop("DBF open failed")
while line := reads(fd,32) do {
write("*line=",*line)
}
end
TESTOFF.DBF happens to have an octal 032 in position 49 of the file.
The above program on MS-DOS returns:
*line=32
*line-16
The above program on my UNIX-pc reads continuous 32 byte lines
until it reaches the real end-of-file.
It appears to me that Version 8 of Icon for MS-DOS will not read past
this CTL-Z (octal 032) character.
Joe Hall
tsommers@zodiac.rutgers.edu (11/13/90)
In article <9011100110.AA00524@megaron.cs.arizona.edu>, pax@pax7300.att.com writes: > Is it possible that Version 8 of Icon on MS-DOS will not read past > an octal 32 with reads??? > > procedure main() > fd := open("TESTOFF.DBF","ru") | stop("DBF open failed") > while line := reads(fd,32) do { > write("*line=",*line) > } > end > > TESTOFF.DBF happens to have an octal 032 in position 49 of the file. > > The above program on MS-DOS returns: > > *line=32 > *line-16 My guess would be that Icon is opening the file in text mode, and that the particular C compiler used to make Icon treats Control-Z as EOF in text mode. If Icon just passes the mode string unaltered to the C fopen (or whatever), then perhaps all that is required is to use the appropriate binary mode mode string when opening the file.