comp.lang.ada
 help / color / mirror / Atom feed
* Is it possible to start another executable from within an ada program?
@ 2003-05-13 15:26 Vincent
  2003-05-13 15:54 ` Larry Kilgallen
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Vincent @ 2003-05-13 15:26 UTC (permalink / raw)


I have a little problem : I am trying to start another .exe from my
ADA program...  Anybody knows of a way to do such a thing?

In a perfect world, I'd prefer the call to be blocking, but I could
also do with a non-blocking call.  Any ideas?

Thanks,

Vincent



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is it possible to start another executable from within an ada program?
  2003-05-13 15:26 Is it possible to start another executable from within an ada program? Vincent
@ 2003-05-13 15:54 ` Larry Kilgallen
  2003-05-13 16:03 ` Is it possible to start another executable from within an adaprogram? David C. Hoos
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Larry Kilgallen @ 2003-05-13 15:54 UTC (permalink / raw)


In article <f7b6c6c4.0305130726.1eca1ea2@posting.google.com>, admin@ctech.ca (Vincent) writes:
> I have a little problem : I am trying to start another .exe from my
> ADA program...  Anybody knows of a way to do such a thing?

I know how to do such a thing, but it is possible you are using a different
operating system and compiler than what I am using.

> In a perfect world, I'd prefer the call to be blocking, but I could
> also do with a non-blocking call.  Any ideas?

I would suggest  more fully explaining your environment.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is it possible to start another executable from within an adaprogram?
  2003-05-13 15:26 Is it possible to start another executable from within an ada program? Vincent
  2003-05-13 15:54 ` Larry Kilgallen
@ 2003-05-13 16:03 ` David C. Hoos
  2003-05-13 16:25 ` Is it possible to start another executable from within an ada program? Martin Krischik
  2003-05-13 21:06 ` Christoph Schlegel
  3 siblings, 0 replies; 6+ messages in thread
From: David C. Hoos @ 2003-05-13 16:03 UTC (permalink / raw)



"Vincent" <admin@ctech.ca> wrote in message
news:f7b6c6c4.0305130726.1eca1ea2@posting.google.com...
> I have a little problem : I am trying to start another .exe from my
> ADA program...  Anybody knows of a way to do such a thing?
>
> In a perfect world, I'd prefer the call to be blocking, but I could
> also do with a non-blocking call.  Any ideas?

Here is a library-level function that invokes the "system" function
of the C-runtime library.

with Interfaces.C;
function Execute_Shell_Command (Command : in String) return Integer
  is
    function Execute (Command : in Interfaces.C.char_array)
       return Interfaces.C.int;
    pragma Import (C, Execute, "system");
  begin --  Execute_Shell_Command
     return Integer (Run (Interfaces.C.To_C (Item => Command)));
end Execute_Shell_Command;

>
> Thanks,
>
> Vincent
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is it possible to start another executable from within an ada program?
  2003-05-13 15:26 Is it possible to start another executable from within an ada program? Vincent
  2003-05-13 15:54 ` Larry Kilgallen
  2003-05-13 16:03 ` Is it possible to start another executable from within an adaprogram? David C. Hoos
@ 2003-05-13 16:25 ` Martin Krischik
  2003-05-13 21:06 ` Christoph Schlegel
  3 siblings, 0 replies; 6+ messages in thread
From: Martin Krischik @ 2003-05-13 16:25 UTC (permalink / raw)


Vincent wrote:

> I have a little problem : I am trying to start another .exe from my
> ADA program...  Anybody knows of a way to do such a thing?

Depends on the compiler you are using. GNAT has a libary for low level OS
access.

If you need some Demo source you might want to look here:

http://adacl.sourceforge.net/html/TestCommand__adb.htm
http://adacl.sourceforge.net/html/______Include__AdaCL-OS-Command__adb.htm#158_9

Of cource this is not finished code.

> In a perfect world, I'd prefer the call to be blocking, but I could
> also do with a non-blocking call.  Any ideas?

GNAT can do both. 

With Regards

Martin

--
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is it possible to start another executable from within an ada program?
  2003-05-13 15:26 Is it possible to start another executable from within an ada program? Vincent
                   ` (2 preceding siblings ...)
  2003-05-13 16:25 ` Is it possible to start another executable from within an ada program? Martin Krischik
@ 2003-05-13 21:06 ` Christoph Schlegel
  2003-05-14 22:36   ` R. Srinivasan
  3 siblings, 1 reply; 6+ messages in thread
From: Christoph Schlegel @ 2003-05-13 21:06 UTC (permalink / raw)


On 13 May 2003 08:26:03 -0700
admin@ctech.ca (Vincent) wrote:

> I have a little problem : I am trying to start another .exe from my
> ADA program...  Anybody knows of a way to do such a thing?

I remember GNAT.Os_Lib.Spawn wich provided a classic C-style spawn-
function. This was comfortable and easy to use for me.

Maybe this helps, maybe it does not -

Christoph



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Is it possible to start another executable from within an ada program?
  2003-05-13 21:06 ` Christoph Schlegel
@ 2003-05-14 22:36   ` R. Srinivasan
  0 siblings, 0 replies; 6+ messages in thread
From: R. Srinivasan @ 2003-05-14 22:36 UTC (permalink / raw)


recent version (3.15p) of gnat also has gnat.expect etc. which is quite
powerful.

"Christoph Schlegel" <modula2@myrealbox.com> wrote in message
news:20030513230631.5b6ab6bf.modula2@myrealbox.com...
> On 13 May 2003 08:26:03 -0700
> admin@ctech.ca (Vincent) wrote:
>
> > I have a little problem : I am trying to start another .exe from my
> > ADA program...  Anybody knows of a way to do such a thing?
>
> I remember GNAT.Os_Lib.Spawn wich provided a classic C-style spawn-
> function. This was comfortable and easy to use for me.
>
> Maybe this helps, maybe it does not -
>
> Christoph





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-14 22:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-13 15:26 Is it possible to start another executable from within an ada program? Vincent
2003-05-13 15:54 ` Larry Kilgallen
2003-05-13 16:03 ` Is it possible to start another executable from within an adaprogram? David C. Hoos
2003-05-13 16:25 ` Is it possible to start another executable from within an ada program? Martin Krischik
2003-05-13 21:06 ` Christoph Schlegel
2003-05-14 22:36   ` R. Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox