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: 10 Apr 2001 12:46:15 -0400
Date: 2001-04-10T17:01:05+00:00	[thread overview]
Message-ID: <uitkcpuso.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: upuekpwjq.fsf@gsfc.nasa.gov

Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> writes:

> "Martin Dowie" <martin.dowie@gecm.com> writes:
> 
> > 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"
> 
> Normally this is done from the command line, when you launch your
> executable. What OS are you on?

Duh; VxWorks! My brain is _not_ in high-power mode. 

Anyway, I don't know how to redirect in VxWorks, but I _think_ it uses
the Posix shell redirection:

adacode > /dev/nul

> 
> 
> 
> > 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?..
> 
> You can use Ada.Text_IO.Set_Output to set the _current_ output to some
> file. But it has to be an open file, and you haven't gotten there yet.
> 
> Backing up a bit, why do you want to do this? I can guess that you
> want to turn off some debugging output. It is _far_ better to define a
> Debug_IO package, with a Boolean or Integer debug enabled variable.
> Then have a style guide that says "Ada.Text_IO is _forbidden_ in
> delivered code; use Debug_IO if you need debug output".
> 
> -- 
> -- Stephe

-- 
-- Stephe



  reply	other threads:[~2001-04-10 16:46 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 [this message]
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
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