home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
- From: dave@cs.arizona.edu (Dave Schaumann)
- Newsgroups: comp.lang.c
- Subject: Re: Executing bins from within C
- Message-ID: <1993Jan1.161207.18465@organpipe.uug.arizona.edu>
- Date: 1 Jan 93 16:12:07 GMT
- References: <1992Dec31.214802.4993@camaro.uucp>
- Sender: news@organpipe.uug.arizona.edu
- Reply-To: dave@cs.arizona.edu (Dave Schaumann)
- Organization: University of Arizona
- Lines: 17
- In-Reply-To: tfoley@camaro.uucp (Tim Foley)
-
- In article <1992Dec31.214802.4993@camaro.uucp>, tfoley@camaro (Tim Foley) writes:
- >eg. How could I run 'ls -l' from within a C program, and see the output as
- >well.
- >
- >Do you use the exec() function?
-
- You can. There are (potentially) a large variety of functions available
- for this purpose, including system(), popen(), and a family of exec()
- functions.
-
- If a fairly simple interface to the run program will due, I'd say use
- system() or popen(). The exec() functions provide a more powerful but
- more complex interface.
-
- --
- The security of the Enterprise is of Paramount importance.
- -Jean Luc Picard, stardate 45965.3
-