From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Attempting to create file i task Date: Wed, 17 Mar 2021 16:37:39 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <6aad7864-7b88-4e73-b4fe-f4cd30673b28n@googlegroups.com> <3315a5c5-7a06-4d9d-a808-9fc5b45dab82n@googlegroups.com> <5a31fadb-95e2-4fdb-abd7-855ba9ff0e2cn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 17 Mar 2021 15:37:40 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="402b06da02cc3a6d8f67d32884511297"; logging-data="28225"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SrhxJCPbaOAEl7k86YBmHXSYapWgx7kg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cancel-Lock: sha1:EN+CDUP/8Z19YQQRGEzAQO4+eBo= In-Reply-To: <5a31fadb-95e2-4fdb-abd7-855ba9ff0e2cn@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61592 List-Id: On 3/17/21 3:47 PM, AdaMagica wrote: > > RM A.10.2(2) For the procedures Create and Open: After a file with mode Out_File or Append_File is opened, the page length and line length are unbounded (both have the conventional value zero). After a file (of any mode) is opened, the current column, current line, and current page numbers are set to one. If the mode is Append_File, it is implementation defined whether a page terminator will separate preexisting text in the file from the new text to be written. > > Doesn't sound like the contents are overwritten. The counting starts with 1, OK, but the old contents should be presevered for Append. Only the presence of a page terminator is implementation defined. ARM A.8.2 says that Create "Establishes a new external file". A new file has no contents. You might also want to look at this discussions here on c.l.a https://groups.google.com/g/comp.lang.ada/c/2JYJeBtpm2g/m/H2TAaPlcBgAJ where Randy Brukardt says that Create with Append_File is defined by the ARM to be the same as Out_File. You might also want to experiment with various compilers and see what they do. -- Jeff Carter "In our experiments, the [Ada] compile[r] was able to find not just typographical errors, but also conceptual errors in the development of the code." Scott and Bagheri 161