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=unavailable 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!feeder.eternal-september.org!news.glorb.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 21 Jan 2016 20:49:54 -0600 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Out_File , excess line Date: Thu, 21 Jan 2016 21:50:23 -0500 Organization: IISS Elusive Unicorn Message-ID: References: <730fcd26-19e5-43e8-a071-5d2881d4a5bc@googlegroups.com> <8760yndy7w.fsf@adaheads.sparre-andersen.dk> <7e5ff177-393c-4164-a5db-312969fec7e1@googlegroups.com> X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.117.17 X-Trace: sv3-dgJsSrHVcMYe89iroL+f81u1Bhj6rhue64+VcRLiAAdfsXaj4KeCApDomzk6C87KN7vU0w019qutxGk!PFTdh31IciWMNiYYYzSHgSepl+Z1e+IIqrslON4v+8O11q2a4NoB84G0+6wxZMTgw1cwN4sVy6/k!6AmnBUu4nwd+W8xj5gc6ihACYKU= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2783 X-Received-Bytes: 2895 X-Received-Body-CRC: 3272908654 Xref: news.eternal-september.org comp.lang.ada:29193 Date: 2016-01-21T21:50:23-05:00 List-Id: On Thu, 21 Jan 2016 08:23:38 -0800 (PST), AdaMagica declaimed the following: >Am Donnerstag, 21. Januar 2016 15:42:58 UTC+1 schrieb Dmitry A. Kazakov: >> On 2016-01-21 12:57, G.B. wrote: >> > On 21.01.16 11:56, AdaMagica wrote: >> >> >> >> 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. >> >> Even if the process does not close the file Windows does this upon >> process termination. However the file end is not set if not closed >> "normally", e.g. per Close call. > >Hm, I tried leaving the program with and without closing the file. The result (on Windows) was both the same, a CR and LF written. >While the file is still open, a dir command shows the file with 0 bytes, after leaving the program, with two bytes (13 10). >Since Windows surely does not add the line terminator, it must be friendly Gnat who's closing the file implicitly. Or could it be that the directory entry is not updated until the file is closed/flushed -- which could be by the OS... after all, if the OS is buffering I/O, a two-byte Ada line marker might not be written to disk until an explicit flush operation. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/