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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Out_File , excess line Date: Thu, 21 Jan 2016 12:57:46 +0100 Organization: A noiseless patient Spider Message-ID: References: <730fcd26-19e5-43e8-a071-5d2881d4a5bc@googlegroups.com> <8760yndy7w.fsf@adaheads.sparre-andersen.dk> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 21 Jan 2016 11:55:00 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="11171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QHpv+tSxgJPLIlCuzi2Cr/L3F2ivCl1o=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: Cancel-Lock: sha1:UGy+WDx8cE2kSoRo0ZLI02yoMbU= Xref: news.eternal-september.org comp.lang.ada:29182 Date: 2016-01-21T12:57:46+01:00 List-Id: On 21.01.16 11:56, AdaMagica wrote: > Am Donnerstag, 21. Januar 2016 11:27:17 UTC+1 schrieb Jacob Sparre Andersen: >> comicfanzine@gmail.com writes: >> >>> Then , i just opened it in Out_file with Ada , and then manually . >>> >>> I haven't closed the file neither . >> >> When an Ada program terminates, all open files are closed. >> >> /Jacob >> -- >> recursive, adj.; see recursive > > See RM A.7(6) The language does not define what happens to external files after the completion of the main program and all the library tasks (in particular, if corresponding files have not been closed). The effect of input-output for access types is unspecified. > > I guess the OP is using GNAT, and this friendly compiler seems to properly close the files upon leaving the scope of a file object. > On Windows, that did not seem to be the case. Always closing files is helpfully reflecting the intent of the programmer.