From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a33ec7badc330d9e X-Google-Attributes: gid103376,public From: emery@grebyn.com (David Emery) Subject: Re: Ada Equivalent of "system()" in C? Date: 1996/04/16 Message-ID: #1/1 X-Deja-AN: 147889551 references: <4l1dbi$pho@rational.rational.com> organization: MIND LINK! - British Columbia, Canada newsgroups: comp.lang.ada Date: 1996-04-16T00:00:00+00:00 List-Id: In article <4l1dbi$pho@rational.rational.com>, rlk@rational.com (Bob Kitzberger) wrote: > : I'm new to Ada programming, having come from a C background. Is > : there an equivalent in Ada of the "system()" function in C that > : allows you execute an external program? > > Take a look at the Posix Ada bindings -- likely provided by > your compiler vendor. The Posix Ada bindings are a standardized > binding definition to Posix/Unix services. Personally, I find > the Posix bindings much nicer to use than using pragma Interface > to the C library routines themselves. > > -- > Bob Kitzberger Rational Software Corporation rlk@rational.com 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. That being said, it's trivial to implement this via pragma interface. The signature is, if I remember correctly (I'm at home and can't check the manpage): int system (const char * cmd); In other words, this takes a single string parameter, the command to execute, and returns an int value if the command was succesfully started. Note that the return value is NOT the return value of the command, but rather of the fork() that is used to set up execution of the command. dave