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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8adae758db494f09 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h48g2000cwc.googlegroups.com!not-for-mail From: "Jens K S" Newsgroups: comp.lang.ada Subject: Re: how to use GNAT.Expect Date: 28 Jul 2006 11:23:00 -0700 Organization: http://groups.google.com Message-ID: <1154110979.998477.30620@h48g2000cwc.googlegroups.com> References: <1153754097.448111.251710@b28g2000cwb.googlegroups.com> NNTP-Posting-Host: 24.215.163.104 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1154110985 27986 127.0.0.1 (28 Jul 2006 18:23:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 28 Jul 2006 18:23:05 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: h48g2000cwc.googlegroups.com; posting-host=24.215.163.104; posting-account=jyjYEA0AAAASGPmGV3SixZnGCmSWvjj8 Xref: g2news2.google.com comp.lang.ada:5998 Date: 2006-07-28T11:23:00-07:00 List-Id: After downloading the newest AdaCore GNAT compiler for OS X the problem is gone. Jens K S wrote: > Hi all, > > I new to Ada and I've been fiddling with this problem for too long > now. > Basically I want to transfer some files using Ada, but since I don't > want to create my own FTP implementation I want to start a new FTP > process from Ada (I use echo in example below). Works fine with > GNAT.OS_Lib, but when I use GNAT.Expect I get no output and an > exception?? What am I doing wrong here? > > By the way, I use Xcode on OS X. Does anyone know how I can "Step > Into" code in the Expect package? This could also help me locate the > problem.... > > -------------------------- code ------------------------------- > with Ada.Text_io; > use Ada.Text_io; > with GNAT.Expect; > with GNAT.OS_Lib; > > procedure ClonesTest is > > Fd: GNAT.Expect.Process_Descriptor; > Timeout: Integer := 10000; -- 10 sec > Result: GNAT.Expect.Expect_Match; > Sucess: boolean; > P: GNAT.OS_Lib.Process_Id; > begin > > -- using Lib > P:= GNAT.OS_Lib.Non_Blocking_Spawn("/bin/echo", (1 => new String' > ("from Lib Non_Block"))); > GNAT.OS_Lib.Spawn ("/bin/echo", (1 => new String' ("from Lib Block")), > Sucess); > > -- using Expect > GNAT.Expect.Non_Blocking_Spawn (Fd, "/bin/echo", (1 => new String' > ("from Expect"))); > GNAT.Expect.Expect (Fd, Result, ".*", Timeout); > Put_Line ("Seen: " & GNAT.Expect.Expect_Out (Fd)); > > Put_Line("Hello, World again with Ada!"); > > end ClonesTest; > > > --------------- Output --------------- > > from Lib Non_Block > from Lib Block > > raised GNAT.EXPECT.PROCESS_DIED : g-expect.adb:594 > > ClonesTest has exited with status 1. > > > Thanks in advance > > Jens