comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado Alves <amado.alves@netcabo.pt>
To: comp.lang.ada@ada-france.org
Subject: [Fwd: Re: SEQUENTIA_IO and stdin/stdout]
Date: Tue, 14 Oct 2003 14:42:10 +0000
Date: 2003-10-14T14:42:10+00:00	[thread overview]
Message-ID: <mailman.79.1066142569.25614.comp.lang.ada@ada-france.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 68 bytes --]

[Sorry, reply button habit. Ada-france, please set Reply-To field.]

[-- Attachment #2: Forwarded message - Re: SEQUENTIA_IO and stdin/stdout --]
[-- Type: message/rfc822, Size: 1042 bytes --]

From: Marius Amado Alves <amado.alves@netcabo.pt>
To: Lo Shu <iin@rgdata.ukrtel.net>
Subject: Re: SEQUENTIA_IO and stdin/stdout
Date: Tue, 14 Oct 2003 14:39:26 +0000
Message-ID: <1066142366.24379.84.camel@a213-22-81-194.netcabo.pt>

On Tue, 2003-10-14 at 12:44, Lo Shu wrote:
> I came from C world and brought the question: how I can open stdin or
> stdout as a SEQUENTIAL file?

As an Ada.Sequential_IO file you can't. But you can achieve what I think
you want to using streams:

with Ada.Text_IO;
with Ada.Text_IO.Text_Streams;

procedure Example is
   type Element is new Character;
   use Ada.Text_IO;
begin
   Element'Write (Text_Streams.Stream (Standard_Output), 'A');
end;      

/*
It is perhaps an unfortunate feature of Ada that the standard i/o
channels are hardwired to the Text_IO file type.
*/

                 reply	other threads:[~2003-10-14 14:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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