/ * * Purpose: Program to demonstrate the popen function. * * to do: Check that the 'popen' was successfull. * * Author: M J Leslie. * Date: 08-Jan-94 */ #include <stdio.h> main() { FILE *fp; char line[130]; /* line of data from unix command*/ fp = popen("ls -l", "r"); /* Issue the command. */ /* Read a line */ while ( fgets( line, sizeof line, fp)) { printf("%s", line); } pclose(fp); }
file: /Techref/language/ccpp/CREF/EXAMPLES/popen.c, 0KB, , updated: 1997/4/21 08:52, local time: 2024/11/26 18:32,
3.139.72.152:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/Techref/language/ccpp/CREF/EXAMPLES/popen.c"> language ccpp CREF EXAMPLES popen</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.