Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!rutgers!zodiac!tsommers From: tsommers@zodiac.rutgers.edu Newsgroups: comp.lang.icon Subject: Re: MSDOS V8 reads Message-ID: <201.273ee591@zodiac.rutgers.edu> Date: 12 Nov 90 18:10:25 GMT References: <9011100110.AA00524@megaron.cs.arizona.edu> Distribution: inet Organization: Rutgers University - Computing Services Lines: 23 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.