comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: redirecting the standard output
Date: 11 Apr 2001 08:06:26 -0400
Date: 2001-04-11T12:21:19+00:00	[thread overview]
Message-ID: <u8zl7iqt9.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 9avdcq$s6j1@cui1.lmms.lmco.com

"Smark" <not.provided@all.com> writes:

> "Martin Dowie" <martin.dowie@gecm.com> wrote in message
> news:3ad31759$1@pull.gecm.com...
> > This time with a subject... :-)
> >
> > Target System: PowerPC, AdaMULTI v1.8.9b, VxWorks 5.4
> >
> > How do I redirect the standard output? I'd like to redirect it to device
> > "/null"
> >
> > Attempts:
> >  Open (DevNull, Append_File, "/null");
> >  Open (DevNull, "/null", "/null");
> >
> > just cause Status_Error, i.e. the device is already "open". So how can
> > I then "Set_Output (DevNull);" without having the device object in
> > File_Type form?..
> >
> >
> 
> I have also had problems redirecting Ada.Text_Io on the same platform.
> When I use the applicable VxWorks calls, ioGlobalStdSet or ioTaskStdSet,
> my printf's from C programs are redirected, but Ada.Text_Io seems to
> be unaffected.  In my case, I'm trying to redirect IO to an open
> socket.
> 
> The solution I'm toying with is making an Ada interface to printf.
> Is there a better way to get Ada IO to respond to calls to the
> above VxWorks functions?

I don't know precisely, but you should definitely ask your Ada vendor
how to do it. If you are using GNAT, look at the source for Text_IO
and see what they are doing.

Interfacing to printf is _not_ easy. 'puts' is a better C function to
call, if you have to resort to that.

-- 
-- Stephe



  reply	other threads:[~2001-04-11 12:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 14:32 redirecting the standard output Martin Dowie
2001-04-10 15:01 ` redirecting the standard output to different std outputs? Frank
2001-04-10 16:17   ` Mark Biggar
2001-04-10 20:38     ` James Rogers
2001-04-13 16:23   ` Tucker Taft
2001-04-10 16:08 ` redirecting the standard output Stephen Leake
2001-04-10 16:46   ` Stephen Leake
2001-04-10 17:13     ` Smark
2001-04-10 21:00   ` Ted Dennison
2001-04-11  7:32   ` Martin Dowie
2001-04-11 12:04     ` Stephen Leake
2001-04-11 14:15       ` Martin Dowie
2001-04-12  1:41     ` tmoran
2001-04-12  7:08       ` Martin Dowie
2001-04-10 16:46 ` Smark
2001-04-11 12:06   ` Stephen Leake [this message]
2001-04-11 14:11     ` Martin Dowie
2001-04-11  0:04 ` Jeff Creem
2001-04-11  9:48 ` Graham Baxter
2001-04-12 12:23   ` Martin Dowie
2001-04-12 14:01     ` Smark
2001-04-12 19:52       ` martin.m.dowie
replies disabled

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