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,90557de632b4af52 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-19 00:06:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!colt.net!newsfeed.esat.net!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed.siemens.de!news.siemens.de!news.mch.sbs.de!not-for-mail From: Alfred Hilscher Newsgroups: comp.lang.ada Subject: Re: Getting Information already displayed on terminal window Date: Fri, 19 Apr 2002 09:06:44 +0200 Organization: Siemens AG Message-ID: <3CBFC204.6A4F0250@icn.siemens.de> References: NNTP-Posting-Host: 139.21.122.158 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:22772 Date: 2002-04-19T09:06:44+02:00 List-Id: Fraz wrote: > > I notice that Ada Gide has an option which redirects the output to a file if > desired. How do i build this into my program? > > I am executing an external program and want to read in the result of this > from the output screen - can i?? > > Cheers > > Fraz Hi, what exactly want you do, start another program from your own program and catching its output, or simply start your program and write the output to a file? (I assume that you use widows as you mentioned AdaGide which is a windows tool) The later can be done by simply redirecting output as under Unix via ">" (tested with NT 4.0) e.g. MY_PROG > file.out 2> file.err The first one can be done with anonymous pipes. For an example, download the AdaGide sources and have a look into package body "RunChoices.adb". Procedure "StartTheProcess" for the start with pipes and function "ReadFromPipe" for how to get the result.