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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,7ae711c481a7059 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-07 11:01:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!luth.se!news-stob.telia.net!telia.net!194.22.194.4.MISMATCH!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: Bj�rn Persson Newsgroups: comp.lang.ada Subject: Re: Can I treat Current_Output as a file of bytes? Message-ID: <20021107200106.69c213fa.bjorn_persson.spam-is-evil@sverige.nu> References: <20021104233454.2042ef78.bjorn_persson.spam-is-evil@sverige.nu> <4519e058.0211050630.7eb31354@posting.google.com> <20021105170130.2684e53f.bjorn_persson.spam-is-evil@sverige.nu> <4519e058.0211051427.48557033@posting.google.com> <4519e058.0211062004.4a55ab0e@posting.google.com> X-Newsreader: Sylpheed version 0.5.0 (GTK+ 1.2.10; i386-redhat-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 07 Nov 2002 19:01:05 GMT NNTP-Posting-Host: 213.64.50.193 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1036695665 213.64.50.193 (Thu, 07 Nov 2002 20:01:05 CET) NNTP-Posting-Date: Thu, 07 Nov 2002 20:01:05 CET Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:30550 Date: 2002-11-07T19:01:05+00:00 List-Id: On 6 Nov 2002 20:04:25 -0800 dennison@telepath.com (Ted Dennison) wrote: > "Randy Brukardt" wrote in message news:... > > I would be very surprised if a compiler implementer went out of their > > way to add stuff there that OS does not add. In this case, neither > > Windows nor Unix adds any line breaks to standard output, so why would > > an Ada compiler? (If you're not using Windows or Unix, your mileage may > > The OP seemed to think that the line break was getting added on the > "Close" call, if I was reading him correctly. Seeing as this method > would require calling the exact same "Close" routine, I think you can > perhaps see the source of my concern. Gnat's Ada.Text_IO does it in a procedure called Terminate_Line that gets called when closing or resetting a text file: procedure Terminate_Line (File : File_Type) is begin FIO.Check_File_Open (AP (File)); -- For file other than In_File, test for needing to terminate last line if Mode (File) /= In_File then -- If not at start of line definition need new line if File.Col /= 1 then New_Line (File); -- For files other than standard error and standard output, we -- make sure that an empty file has a single line feed, so that -- it is properly formatted. We avoid this for the standard files -- because it is too much of a nuisance to have these odd line -- feeds when nothing has been written to the file. elsif (File /= Standard_Err and then File /= Standard_Out) and then (File.Line = 1 and then File.Page = 1) then New_Line (File); end if; end if; end Terminate_Line; As you can see, standard out and standard error are excepted if the page, line and column numbers are all 1, and since stream operations don't affect these numbers, I get rid of the line break if I write everything through the stream. For disk files the line break is always added, but for those I can use Sequential_IO, which will hopefully only write what I tell it to write. Bj�rn Persson