From: Pascal Obry on
Le 06/02/2010 18:39, Gautier write-only a �crit :
> Hello,
>
> Does someone have some nice open source to do that ?

What about GNAT.Expect?

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net - http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

From: Gautier write-only on
On Feb 6, 7:23 pm, Pascal Obry <pas...(a)obry.net> wrote:

> What about GNAT.Expect?

Thanks, it looks exactly what I need. Just need to use it correctly.
Fortunately there is an example there:
http://www.adacore.com/2008/11/24/gem-54/
Just need to find how pipe the process' output to a string buffer.
An idea ? I guess it is a 1-liner with GNAT.Expect.
Thanks again
_________________________________________________________
Gautier's Ada programming -- http://sf.net/users/gdemont/
NB: For a direct answer, e-mail address on the Web site!
From: Jeffrey R. Carter on
Gautier write-only wrote:
>
> Does someone have some nice open source to do that ?
> I began to cannibalize working code from AdaGIDE, but it is a bit
> messy.
> If I can save a couple of hours to make a good package out of it, it
> would be cool...

I used to do something like this to get a directory listing in Ada 95: Using
GNAT.OS_Lib I spawned cmd and redirected the output to a file, then read the
file from my program. Not nearly as complex as what you're after, but it worked
for my purposes and only took a few minutes to get working.

--
Jeff Carter
"It's symbolic of his struggle against reality."
Monty Python's Life of Brian
78
From: Dmitry A. Kazakov on
On Sat, 6 Feb 2010 09:39:30 -0800 (PST), Gautier write-only wrote:

> Does someone have some nice open source to do that ?
> I began to cannibalize working code from AdaGIDE, but it is a bit
> messy.
> If I can save a couple of hours to make a good package out of it, it
> would be cool...
> TIA
>
> [ the goal is to have a reusable object-oriented component; its first
> usage would be in the GWenerator tool for launching gnatmake or a
> resource compiler and display its output in boxes ]

For same purpose (launching gprbuild and catching the output and error
streams) I used GTK+ bindings.

I considered GNAT.OS_Lib, but dropped that for various reasons. Since GTK+
API are quite tricky when it comes to process spawning, I built thicker
bindings on top. Spawning a process with pipes:

http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#10.1

and with text buffers instead of pipes

http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#10.2

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Vadim Godunko on
On Feb 6, 8:39 pm, Gautier write-only <gautier_niou...(a)hotmail.com>
wrote:
> Hello,
>
> Does someone have some nice open source to do that ?
QProcess class from Qt (and QtAda) can be used for that.