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!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: Mon, 24 Aug 2015 19:06:54 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Creating an empty file with Ada.Text_IO Date: Mon, 24 Aug 2015 20:06:54 -0400 Organization: IISS Elusive Unicorn Message-ID: <84cntalfhijjvepn1qq1ha6456k08sf2vf@4ax.com> References: 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.68.178.61 X-Trace: sv3-o0SVMZRjZXDDfVJ1sg92wWrcohz7EqbsVwcp37rBV5bqvcojeqz76Ed06XXk6ONsMluNT3Az9vPMNIz!jM18nGkuql4Bq5KGGG6IdB1xXkvCaTlRIGijF0GU+2gKazEV1kpZq3fmPXp+rktWue/zw7ESAmCu!QDlJKP9pAIcgfOxWSP/Ucdk1NE8= 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: 2345 Xref: news.eternal-september.org comp.lang.ada:27600 Date: 2015-08-24T20:06:54-04:00 List-Id: On Mon, 24 Aug 2015 07:16:45 -0700 (PDT), Maciej Sobczak declaimed the following: > >The program creates a file, but before the file is closed, a newline character(s) is written to it. It is, physically, not empty. >Similarly, if a non-terminated line is written (by means of Ada.Text_IO.Put), it is automatically terminated by a newline. > And that IS the documented standard... Actually, you are lucky that the new-line is all you see, as the standard would have the Close operation ensure the file ends with: new-line, new-page, end-of-file (but does not mandate how those states are represented in the file -- suspect EOF is mostly handled as meta-data in the directory entry rather than an explicit character) >I understand that the intent of the Ada.Text_IO package was to provide a line-oriented file I/O, but it is sometimes getting in the way. >What are the recommended ways of: >a) creating empty files >b) writing a non-terminated line to (or generally at the end of) the file > >? As has been mentioned, Stream_IO was sort of created for this role. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/