From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: GNAT's Text_IO & empty files
Date: 1998/07/07
Date: 1998-07-07T00:00:00+00:00 [thread overview]
Message-ID: <EACHUS.98Jul7165436@spectre.mitre.org> (raw)
In-Reply-To: 35A200D9.E5AAC021@maths.unine.ch
In article <35A200D9.E5AAC021@maths.unine.ch> Gautier <gautier.demontmollin@maths.unine.ch> writes:
> Maybe you mean that the line feed is a line and file terminator . It's true
> on Unix, it false on DOS or Windows, where it is a line separator.
> It's like the ';' which follows intructions in Ada but separate them
> in Pascal.
> << These lines were not put in for amusement! >>
> Oh, you surprise me! Are you serious?
It is possible to have a mapping in Text_IO such that an empty file
contains no bytes. However, to do that correctly requires relying on
state in the (Ada) file descriptor, since the Ada notion of a text
file ends with an line terminator, followed by a page terminator,
followed by the end of file. Try it. Open an empty file for reading,
and call Page. It will return 1. Now call End_of_File. It will
return true. Now call Skip_Line (or Skip_Page). Page is now 2, but
End_of_File is still true. Call Skip_Line again and get End_Error.
--
Robert I. Eachus
with Standard_Disclaimer;
use Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...
next prev parent reply other threads:[~1998-07-07 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 ` Pascal MALAISE
1998-07-07 0:00 ` Gautier
1998-07-07 0:00 ` Kevin Radke
1998-07-06 0:00 ` Robert Dewar
1998-07-07 0:00 ` Markus Kuhn
1998-07-07 0:00 ` Robert Dewar
1998-07-07 0:00 ` Michael F Brenner
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 ` Samuel Tardieu
1998-07-09 0:00 ` Gautier.DeMontmollin
1998-07-08 0:00 ` dennison
1998-07-07 0:00 ` Gautier
1998-07-07 0:00 ` Robert I. Eachus [this message]
1998-07-07 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox