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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.170.87 with SMTP id t84mr22965390ioe.18.1440425805482; Mon, 24 Aug 2015 07:16:45 -0700 (PDT) X-Received: by 10.182.213.164 with SMTP id nt4mr38653obc.39.1440425805463; Mon, 24 Aug 2015 07:16:45 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!us.feeder.erje.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.ripco.com!news.glorb.com!x6no4032427igd.0!news-out.google.com!nt1ni13699igb.0!nntp.google.com!se8no9500623igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 24 Aug 2015 07:16:45 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=31.186.238.49; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 31.186.238.49 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Creating an empty file with Ada.Text_IO From: Maciej Sobczak Injection-Date: Mon, 24 Aug 2015 14:16:45 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:27593 Date: 2015-08-24T07:16:45-07:00 List-Id: Consider: with Ada.Text_IO; use Ada.Text_IO; procedure Test is F : File_Type; begin Create (F, Out_File, "file.txt"); Close (F); end Test; 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. 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 ? -- Maciej Sobczak * http://www.inspirel.com