From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b2077f5b728fb9af X-Google-Attributes: gid103376,public X-Google-Thread: 114c38,b2077f5b728fb9af X-Google-Attributes: gid114c38,public X-Google-ArrivalTime: 2001-04-10 09:58:03 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada,comp.os.vxworks Subject: Re: redirecting the standard output Date: 10 Apr 2001 12:46:15 -0400 Organization: NASA Goddard Space Flight Center Message-ID: References: <3ad31759$1@pull.gecm.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 986922065 2533 128.183.220.71 (10 Apr 2001 17:01:05 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 10 Apr 2001 17:01:05 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 Xref: supernews.google.com comp.lang.ada:6717 comp.os.vxworks:6382 Date: 2001-04-10T17:01:05+00:00 List-Id: Stephen Leake writes: > "Martin Dowie" 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