comp.lang.ada
 help / color / mirror / Atom feed
From: Steve Quinlan <steven.quinlan@lmco.com>
Subject: Re: Running external programs in ADA.
Date: 1999/02/25
Date: 1999-02-25T00:00:00+00:00	[thread overview]
Message-ID: <36D58583.63CD3358@lmco.com> (raw)
In-Reply-To: Pine.SOL.4.02A.9902251428030.18391-100000@dcsun2.comp.brad.ac.uk

In the simplest case, you would define a function  spec:

function system (cmd : in string) return integer;
and implement it by pragma import (C, system).

Pass the command to be executed in the cmd parameter, adding an "&" if you
don't want to block, (and an ASCII nul always).

To be more correct, use the appropriate types out of interfaces.C(.*) for
int and string. That helps in converting Ada strings to C char arrays.

Check your system to see which shell the system call executes the command
under -- this can make a difference!






  reply	other threads:[~1999-02-25  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-25  0:00 Running external programs in ADA Matthew Butt
1999-02-25  0:00 ` Steve Quinlan [this message]
1999-02-25  0:00 ` David C. Hoos, Sr.
1999-02-25  0:00 ` dennison
replies disabled

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