comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Ada Equivalent of "system()" in C?
Date: 1996/04/17
Date: 1996-04-17T00:00:00+00:00	[thread overview]
Message-ID: <dewar.829741850@schonberg> (raw)
In-Reply-To: emery-1604961854590001@line029.nwm.mindlink.net

Dave Emery said

"The Unix function system() is not included in POSIX.1 or POSIX.5.  I
believe that it is included in the POSIX.1a revision that is still in
development."

However, it *is* in fact in the ANSI C standard, although the semantics
are pretty much entirely implementation defined.

In general the Ada standard library avoids functions that cannot be
well defined in a portable manner, although, to be honest, the command
line interface is pretty much in this category already.

Anyway, Peter's recipe for interfacing to C is certainly one approach.

If you are using GNAT, you could also use GNAT.OS_Lib.Spawn. Spawn is
a routine in the GNAT supplied predefined package GNAT.OS_Lib which has
a handful of useful operating systems interfaces (it is the interface
used by the GNAT compiler itself). Here is the documentatoin from the
spec:

   procedure Spawn
     (Program_Name : String;
      Args         : Argument_List;
      Success      : out Boolean);
   --  The first parameter of function Spawn is the full path name of the
   --  executable. The second parameter contains the arguments to be passed
   --  to the program. Success is false if the program could not be spawned
   --  or its execution completed unsuccessfully. Note that the caller will
   --  be blocked until the execution of the spawned program is complete.






  parent reply	other threads:[~1996-04-17  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-15  0:00 Ada Equivalent of "system()" in C? Dave Sparks
1996-04-16  0:00 ` Samuel Tardieu
1996-04-16  0:00 ` Robert Dewar
1996-04-17  0:00   ` Samuel Tardieu
1996-04-17  0:00   ` Bob Kitzberger
1996-04-16  0:00     ` David Emery
1996-04-17  0:00       ` Keith Thompson
1996-04-17  0:00       ` Robert Dewar [this message]
1996-04-22  0:00         ` Sandy Wise
1996-04-19  0:00       ` Ron J Theriault
replies disabled

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