comp.lang.ada
 help / color / mirror / Atom feed
* Exec command in ada.
@ 2003-02-28 10:07 Mark
  2003-02-28 11:44 ` Frank Piron
  2003-02-28 18:18 ` tmoran
  0 siblings, 2 replies; 9+ messages in thread
From: Mark @ 2003-02-28 10:07 UTC (permalink / raw)



Does anybody have any experiance using exec() style commands from within
ada?

I have looked in : Ada as a second Language
		   The Lovelace tutorial
		   Ada95 Third Edition.

I have(as yet) been unable to find what I am looking for, does Ada have a
method/package available to interface with the shell? Or is it just that I
have missed something relevant in one of the above books and should just
import the C pragma (something I am trying to avoid).

What I am wanting to do is something a little "perl-esque",

exec(program, argument);

any thoughts?

Thanks for all of the help, Having used this list in the past I know that
I am likely to get a helpful response (the kernel module does just about work).

many thanks,

	Mark
   www.vulndev.org




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

* Re: Exec command in ada.
  2003-02-28 10:07 Exec command in ada Mark
@ 2003-02-28 11:44 ` Frank Piron
  2003-03-02 18:37   ` Richard Riehle
  2003-02-28 18:18 ` tmoran
  1 sibling, 1 reply; 9+ messages in thread
From: Frank Piron @ 2003-02-28 11:44 UTC (permalink / raw)


Mark schrieb:
> 
> Does anybody have any experiance using exec() style commands from within
> ada?

If you are using gnat have a look at spawn() and 
non_blocking_spawn() in gnat.os_lib.

Frank



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

* Re: Exec command in ada.
  2003-02-28 10:07 Exec command in ada Mark
  2003-02-28 11:44 ` Frank Piron
@ 2003-02-28 18:18 ` tmoran
  1 sibling, 0 replies; 9+ messages in thread
From: tmoran @ 2003-02-28 18:18 UTC (permalink / raw)


> Does anybody have any experiance using exec() style commands from within
> ada?
 Yes.
> I have looked in : Ada as a second Language
>                    The Lovelace tutorial
>                    Ada95 Third Edition.
  Ada is a language used on many different OSes, and sometimes on bare
hardware, so an "exec()" does not always exist.  Therefore you are
unlikely to find it in a general Ada book.  Most compiler vendors,
however, supply such a thing with their compiler if at all possible,
so look in your compiler docs.



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

* Re: Exec command in ada.
  2003-02-28 11:44 ` Frank Piron
@ 2003-03-02 18:37   ` Richard Riehle
  2003-03-02 20:20     ` sk
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Richard Riehle @ 2003-03-02 18:37 UTC (permalink / raw)


Frank Piron wrote:

> If you are using gnat have a look at spawn() and
> non_blocking_spawn() in gnat.os_lib.

Don't see this in the documentation.  Can you provide
a five or six line program example?

Richard Riehle




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

* Re: Exec command in ada.
  2003-03-02 18:37   ` Richard Riehle
@ 2003-03-02 20:20     ` sk
  2003-03-02 20:26     ` Simon Wright
  2003-03-02 22:30     ` Pascal Obry
  2 siblings, 0 replies; 9+ messages in thread
From: sk @ 2003-03-02 20:20 UTC (permalink / raw)
  To: richard, comp.lang.ada mail to news gateway

Hi,

richard@adaworks.com :
 > ... example ...

package GOSL renames Gnat.Os_Lib;

Args : GOSL.Argument_List := (
     GOSL.Argument_String_To_List ("-c hello.adb").All
);


1)
Spawn_Result := GOSL.Spawn (
     Program_Name    => "/usr/gnat/bin/gnatmake",
     Args            => Args
);

2)
GOSL.Spawn (
     Program_Name    => "/usr/gnat/bin/gnatmake",
     Args            => Args,
     Success         => Success_Flag
);

3)
Called_Process := GOSL.Non_Blocking_Spawn (
     Program_Name    => "/usr/gnat/bin/gnatmake",
     Args            => Args
);

...

Wait_Process (Called_Process, Success_Flag);
-- 
-------------------------------------------------
-- Merge vertically for real address
--
--     s n p @ t . o
--      k i e k c c m
-------------------------------------------------




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

* Re: Exec command in ada.
  2003-03-02 18:37   ` Richard Riehle
  2003-03-02 20:20     ` sk
@ 2003-03-02 20:26     ` Simon Wright
  2003-03-02 22:30     ` Pascal Obry
  2 siblings, 0 replies; 9+ messages in thread
From: Simon Wright @ 2003-03-02 20:26 UTC (permalink / raw)


Richard Riehle <richard@adaworks.com> writes:

> Frank Piron wrote:
> 
> > If you are using gnat have a look at spawn() and
> > non_blocking_spawn() in gnat.os_lib.
> 
> Don't see this in the documentation.

There is quite a large comment for Spawn in the spec file, & the
others refer to it .. normal for GNAT, the info in gnat_rm is just a
hint ..



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

* Re: Exec command in ada.
  2003-03-02 18:37   ` Richard Riehle
  2003-03-02 20:20     ` sk
  2003-03-02 20:26     ` Simon Wright
@ 2003-03-02 22:30     ` Pascal Obry
  2003-03-02 23:47       ` Richard Riehle
  2 siblings, 1 reply; 9+ messages in thread
From: Pascal Obry @ 2003-03-02 22:30 UTC (permalink / raw)



Richard Riehle <richard@adaworks.com> writes:

> Frank Piron wrote:
> 
> > If you are using gnat have a look at spawn() and
> > non_blocking_spawn() in gnat.os_lib.
> 
> Don't see this in the documentation.  

The spec sources is the documentation.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



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

* Re: Exec command in ada.
  2003-03-02 22:30     ` Pascal Obry
@ 2003-03-02 23:47       ` Richard Riehle
  2003-03-03 16:05         ` Pascal Obry
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Riehle @ 2003-03-02 23:47 UTC (permalink / raw)


Pascal Obry wrote:

> Richard Riehle <richard@adaworks.com> writes:
>
> > Frank Piron wrote:
> >
> > > If you are using gnat have a look at spawn() and
> > > non_blocking_spawn() in gnat.os_lib.
> >
> > Don't see this in the documentation.
>
> The spec sources is the documentation.
>
> Pascal.

HmmmmMMMMmmmmm.  Someone could do a great favor to
the GNAT users by creating an HTML file of these obscure
resources, or a link from the GNAT user's manual to them. It
is quite annoying to browse through source files in search of
useful features or discover them by surprise.

Richard Riehle




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

* Re: Exec command in ada.
  2003-03-02 23:47       ` Richard Riehle
@ 2003-03-03 16:05         ` Pascal Obry
  0 siblings, 0 replies; 9+ messages in thread
From: Pascal Obry @ 2003-03-03 16:05 UTC (permalink / raw)



Richard Riehle <richard@adaworks.com> writes:

> HmmmmMMMMmmmmm.  Someone could do a great favor to
> the GNAT users by creating an HTML file of these obscure
> resources, or a link from the GNAT user's manual to them. 

There is a link in the GNAT Reference Manual. All GNAT units are
described here, the details being in the sources.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



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

end of thread, other threads:[~2003-03-03 16:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-28 10:07 Exec command in ada Mark
2003-02-28 11:44 ` Frank Piron
2003-03-02 18:37   ` Richard Riehle
2003-03-02 20:20     ` sk
2003-03-02 20:26     ` Simon Wright
2003-03-02 22:30     ` Pascal Obry
2003-03-02 23:47       ` Richard Riehle
2003-03-03 16:05         ` Pascal Obry
2003-02-28 18:18 ` tmoran

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