popen function

popen is used to read and write to a unix pipe.

This function is NOT included in 'C Programming Language' (ANSI) but can be found in 'The Standard C Library' book.

Library:   stdio.h

Prototype: FILE *popen(const char *command, const char *type);

Syntax:    FILE *fp;
	   fp = popen( "ls -l", "r");

	command - is the command to be issued.
	type    - r - read O/P from command.
                - w - Write data as I/P to command.


example program.


See Also:

Top Master Index Keywords Functions

Martin Leslie