From: Gautier.DeMontmollin@maths.unine.ch
Subject: Re: GNAT's Text_IO & empty files
Date: 1998/07/09
Date: 1998-07-09T00:00:00+00:00 [thread overview]
Message-ID: <m5IsbdWqXQh+@nedcu4> (raw)
In-Reply-To: pdxk95ogpwl.fsf@vesuri.Helsinki.FI
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
next prev parent reply other threads:[~1998-07-09 0:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-07-06 0:00 GNAT's Text_IO & empty files Gautier de Montmollin
1998-07-06 0:00 ` Robert Dewar
1998-07-07 0:00 ` Markus Kuhn
1998-07-07 0:00 ` Michael F Brenner
1998-07-07 0:00 ` Robert Dewar
1998-07-07 0:00 ` Markus Kuhn
1998-07-07 0:00 ` Gautier
1998-07-07 0:00 ` Samuel Tardieu
1998-07-08 0:00 ` Aaro Koskinen
1998-07-09 0:00 ` Gautier.DeMontmollin [this message]
1998-07-09 0:00 ` Samuel Tardieu
1998-07-08 0:00 ` dennison
1998-07-07 0:00 ` Gautier
1998-07-07 0:00 ` Robert Dewar
1998-07-07 0:00 ` Robert I. Eachus
1998-07-06 0:00 ` Pascal MALAISE
1998-07-07 0:00 ` Gautier
1998-07-07 0:00 ` Kevin Radke
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox