From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 5 Feb 93 17:04:00 GMT From: olivea!charnel!rat!koko.csustan.edu!nic.csu.net!vmsa.is.csupomona.edu!lin @ames.arc.nasa.gov (Johnny Lin) Subject: Re: Two "Simple" I/O Questions Message-ID: <5FEB199309042794@vmsa.is.csupomona.edu> List-Id: In article <1993Feb5.083009.26460@cs.ucla.edu>, gast@CS.UCLA.EDU (David Gast) w rites... >Essentially, I just want a program like "cp" or "cat". All it has >to do is copy the input to the output. I have found two problems. > >1) Text_IO does not handle 8-bit characters. Is there another > package which does? really? I didn't know that. It sounds interesting to investigave about it. >2) If there are multiple s at the end of a file, only one > get reads. A skipline at this point skips over all the trailing > s. There is a sample program in a book which says it copies > input to output exactly, but it fails on this case. Perhaps it > is a compiler error. Any solutions? I disagree that skip_line would skip over all the trailing s. I just did project which has a multiple s and it didn't skip all when I tested it. The following is a part of lexical analyzer of compiler which I am writing. This code reads a file throught the standard input and loads the info into the assigned buffer. for i in 0 .. BLOCK_SIZE - 1 loop if END_OF_FILE then BUFFER (LEX_END + i) := ASCII.EOT; exit; elsif END_OF_LINE then BUFFER (LEX_END + i) := ASCII.CR; SKIP_LINE; else GET (BUFFER (LEX_END + i)); end if; end loop; >Thanks > >David > >gast@cs.ucla.edu I hope this helps. Johnny internet : LIN@CSUPomona.edu packet : KC6DMH @ N6CUS.#SOCA.CA.USA.NA