Hi all,

I'd like to understand the general idea of the popen().

The terms I could not get by reading the manual are:
"Process File Pointer"
"Pipe"

Also, I'm not sure why string mode is required to run a script in the background.

What is the difference between the followings? Both just fork the $script, don't they?

popen("php -f $script", "r");
exec("php -f $script > /dev/null &");

    pipes:
    http://www2.linuxjournal.com/article/2156

    i'm not sure what they mean by 'process file pointer' but i would guess that it is similar to what you get when you connect to a DB or open a file using fopen. if you echo it, it will return an integer but that integer really refers to some resource like data in memory or some function in memory and will be properly interpreted by the functions that are allowed to be used on it.

    as for 'forking' i believe that exec() doesn't fork, it blocks.

      Write a Reply...