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,cc1e5a80c87c0755 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-25 14:01:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!fu-berlin.de!uni-berlin.de!bgo1-bap1-217-190-112.adsl.tele2.NO!not-for-mail From: Jarle Thorsen Newsgroups: comp.lang.ada Subject: Re: Running external program, getting output Date: 25 Jun 2003 22:39:12 +0200 Sender: jarle@maskin.flamestrike.no-ip.org Message-ID: References: <5972474.ITsLBhBNCF@linux1.krischik.com> NNTP-Posting-Host: bgo1-bap1-217-190-112.adsl.tele2.no (193.217.190.112) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: fu-berlin.de 1056574860 28568710 193.217.190.112 (16 [132008]) X-Orig-Path: flamestrike.no-ip.org!news User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Portable Code) Xref: archiver1.google.com comp.lang.ada:39742 Date: 2003-06-25T22:39:12+02:00 List-Id: Martin Krischik writes: > Jarle Thorsen wrote: > > > As far as I have gathered the best way of (non OS-specific) running an > > external program from Ada is using the Spawn procedure in g-os_lib, > > correct ? > > > > But how do I get the output from the command that I run? Lets say that I > > want to run "ls" for example..... > > AdaCL has a support class do just this. See TestCommand (test 3) on how to > do it: > > http://adacl.sourceforge.net/html/TestCommand-Main__adb.htm > > You find AdaCL at: > > http://www.ada.krischik.com > > Also, you can use the GNAT.Expect package. Reading your suggestions and also packages provided by other posters I am getting really unsure which way to go... My main focus is making it as portable as possible, yet as simple as possible. My program will 90% percent of the time wait for the spawned program to end before printing its output, but will on some occations read information from the program's pipe while it is still running.... Any clues on which solution to choose ? -- Jarle Thorsen