From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f7e3d24b1fe22fd X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: End_Of_File does not work as expected... Date: 2000/11/26 Message-ID: <3A20EFFD.5EE29272@mail.com>#1/1 X-Deja-AN: 697851957 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en,pdf Content-Type: text/plain; charset=us-ascii Organization: VTX Services SA Mime-Version: 1.0 Reply-To: matsw@mail.com Newsgroups: comp.lang.ada Date: 2000-11-26T00:00:00+00:00 List-Id: I find Jeff Carter's reply overly pedantic and paternalistic, given the reasonable question being asked. And students are welcome to this newsgroup. Now to the point: If you are used to C and UNIX text files, then Text_IO is definitely something different. On some systems, (e.g. VMS) a line terminator is not encoded as a character as it is on UNIX, but as the end of a record. Text_IO was designed to accomodate such systems as well. If you want to write the equivalent of UNIX's echo using Text_IO, you must follow the complete file structure including lines and pages: while not End_Of_File loop while not End_Of_Page loop while not End_Of_Line loop Get(c); Put(c); end loop; Skip_Line; -- can be omitted. New_Line; end loop; Skip_Page; -- can be omitted. New_Page; end loop; You can omit the page stuff if you don't need it, but you will have to use End_Of_Line and New_Line because otherwise your output file is going to be a single line. Note that if you use End_Of_Page/New_Page, then you will have a page terminator at the end of your output file even though the input file has none. My advice: ignore pages in Text_IO.