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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7ae711c481a7059 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-07 13:04:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.nuthinbutnews.com!propagator2-sterling!news-in-sterling.newsfeed.com!news-in.nuthinbutnews.com!telocity-west!TELOCITY!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Can I treat Current_Output as a file of bytes? Date: Thu, 7 Nov 2002 15:04:35 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: 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: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:30557 Date: 2002-11-07T15:04:35-06:00 List-Id: Ted Dennison wrote in message <4519e058.0211062004.4a55ab0e@posting.google.com>... >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. > >But you'd certainly know better than I what *should* be happening.... Well, Ada does require that a file be terminated by a line terminator. Some implementations do actually write this character out if it is missing. Indeed, the first (Ada 83) version of Text_IO for Janus/Ada worked this way. However, users were unhappy with that. Especially so with the page terminator. You never want to write a page terminator unless it is explicitly asked for. Luckily, you don't have to have an explicit page terminator to have the semantics work right. You just have to "assume" one at the end of a file. Doing the same for line terminators isn't much additional work, and doing so eliminates weird behavior at the end of files that don't have explicit terminators. A lot of the code in Text_IO is there to handle these cases properly. IMHO, Text_IO should never write anything on 'Close', and this discussion (again) shows why. But it is true that some implementations do. I'd suggest complaining to the vendor if this is a problem. Randy Brukardt