popen

popen

popen

popen
- It opens process file pointer

Syntax:

int popen ( string command, string mode)

It opens a pipe to a process executed by forking the command given by command.
It returns a file pointer identical to that returned by fopen(), except that it is unidirectional (may only be used for reading or writing) and must be closed with pclose().

This pointer may be used with fgets(), fgetss(), and fputs().

If an error occurs, returns FALSE.

Example:

$fp = popen (”test.txt”, “r”);

Using this process file pointer $fp, we can perform read and write operations on this file test.txt.

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.