Component index
Section index

Component walkpopen


Search

	/*
	    walkpopen is used to execute a sub-program and grab the output.
	*/
	<mod>
	static void sample_walkpopen()
	{
	    // A very short example to extract the output of a command
	    <call walkpopen>("ls -l",10);
	    <f oneline>
	        printf ("%s\n",line);
	    </f>
	    </call>
	
	    // This time, we execute from the current directory
	    // This will produce some error messages
	    <call walkpopen>("ls -l *.c *.missing",10,true);
	    <f oneline>
	        printf ("%s\n",line);
	    </f>
	    <f oneerr>
	        printf ("ERROR: %s\n",line);
	    </f>
	    </call>
	}
	</mod>