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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fb00b4031f5d9d4a,start X-Google-Attributes: gid103376,public From: Gautier de Montmollin Subject: GNAT's Text_IO & empty files Date: 1998/07/06 Message-ID: <35A0B7C5.1011D794@Maths.UniNe.CH>#1/1 X-Deja-AN: 368866979 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: "jvandyk@ibm.net" Content-Type: text/plain; charset=us-ascii Newsgroups: comp.lang.ada Date: 1998-07-06T00:00:00+00:00 List-Id: When you create a text file and close it without writing anything in it, you get an empty line. This is due to an explicit statement in procedure Terminate_Line from Ada.Text_IO. This causes an annoying compatibility problem a in DOS or Windows context, since you get a 1-line, 2-bytes text instead of a 0-line, 0-byte one. My question is: Is it a (a) text file formatting question or (b) a file terminator question ? The (b) point of view would be that Text_IO tries to have a line feed at the end of each text file, although the only explicit (and facultative) file terminator seems to be the EOF character. Mine is (a) and I feel it's both harmless and profitable to comment out the lines following this remark in procedure Terminate_Line: -- For files other than standard error and standard output, we -- make sure that an empty file has a single line feed, so that -- it is properly formatted. We avoid this for the standard files -- because it is too much of a nuisance to have these odd line -- feeds when nothing has been written to the file. elsif (File /= Standard_Err and then File /= Standard_Out) and then (File.Line = 1 and then File.Page = 1) then New_Line (File); end if; Comments ?... Reactions ?... -- Gautier