comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: End_Of_File underspecified?
Date: 21 Nov 2006 09:40:57 -0800
Date: 2006-11-21T09:40:57-08:00	[thread overview]
Message-ID: <1164130857.227365.140900@e3g2000cwe.googlegroups.com> (raw)
In-Reply-To: ejv3l0$q9a$1@cernne03.cern.ch

Maciej Sobczak wrote:
> Hi,
>
> I cannot find any specification of whether End_Of_File can be a blocking
> operation.
> Unfortunately, my experience from other languages breaks into pieces
> here, because Ada uses EOF a bit differently (in other languages the EOF
> flag is set *after* hitting the end of file and as a result of it, so
> that querying the flag is just this - querying the flag).
>
> I would expect that End_Of_File is a non-blocking predicate that allows
> the programmer to take the decision on what to do next with the file.
> Curiously, it does not seem to be the case - End_Of_File can block,
> which is easy to demonstrate on a regular Unix-like (GNAT) system.
>
> Nothing in ARM mentions this.

I assume you're talking about a "potentially blocking" operation?
9.5.1(18) says, "In particular, the subprograms of the language-defined
input-output packages that manipulate files (implicitly or explicitly)
are potentially blocking."  AI95-178 and AARM05 9.5.1(18.a/2) says that
any subprogram in a language-defined I/O package (or instance thereof)
that has a file parameter or result, or operates on a default file, is
considered to manipulate a file.  This includes pretty much everything,
including End_Of_File.  I suppose you're right that the explanation of
"manipulation" isn't, technically, in the ARM---maybe a Note should be
added, although it may be too late.

                              -- Adam




      reply	other threads:[~2006-11-21 17:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-21 14:49 End_Of_File underspecified? Maciej Sobczak
2006-11-21 17:40 ` Adam Beneschan [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox