home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19117 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  1.2 KB

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