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 X-Google-Attributes: gid103376,public From: Gautier.DeMontmollin@maths.unine.ch Subject: Re: GNAT's Text_IO & empty files Date: 1998/07/09 Message-ID: #1/1 X-Deja-AN: 369854937 References: <35A0B7C5.1011D794@Maths.UniNe.CH> Organization: University of Neuchatel, Switzerland Newsgroups: comp.lang.ada Date: 1998-07-09T00:00:00+00:00 List-Id: aaro@iki.fi (Aaro Koskinen) writes: > Check the POSIX.2 definition of a text file. It says that lines > terminate with LF, and a text file contains at least one line. More and more interesting... Is it so explicit in the Ada 95 definition of a text file ? If no, there is a debate of whether we need compatibity between different GNAT ports _or_ between a GNAT port and the programs surrounding it. The two notions are, in this case, partly incompatible... To satisfy the 2nd, I suggest something like: type t_text_file_style is (unix,dos); text_file_style: t_text_file_style: constant boolean:= unix; The output will conform to text_file_style - not more than elsif text_file_style = unix and then (File /= Standard_Err and then File /= Standard_Out) and then (File.Line = 1 and then File.Page = 1) then New_Line (File); end if; in Terminate_Line. The input will be as tolerant as possible to satisfy the 1st compatibility notion. N.B.: I make abstraction of the fact that Unix'CR = DOS'CR/LF; this is translated transparently now via networks or utilities or by lower level IO. -- Gautier