with the code below, $rv is 0 :-)
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file','stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
With the code below, $rv is -1 :-(
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file',stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
$done=false;
while ($done===false) {
$pstat=proc_get_status($proc);
if (!$pstat['running']) $done=true;
usleep(500000);
}
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
Why oh why?
With the code below, $rv is -1 :-(
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file',stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
$done=false;
while ($done===false) {
$pstat=proc_get_status($proc);
if (!$pstat['running']) $done=true;
usleep(500000);
}
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
Why oh why?
Hello,[...]
with the code below, $rv is 0 :-)
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file','stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
Hello,
with the code below, $rv is 0 :-)
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file','stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
With the code below, $rv is -1 :-(
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file',stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
$done=false;
while ($done===false) {
$pstat=proc_get_status($proc);
if (!$pstat['running']) $done=true;
usleep(500000);
}
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
Why oh why?
Hello,
with the code below, $rv is 0 :-)
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file','stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
With the code below, $rv is -1 :-(
--- begin code --- $pdesc=[0=>['pipe','r'],1=>['file','stdout.log','w'],2=>['file',stderr.log','w']];
$proc=proc_open('sleep 3',$pdesc,$pipes);
$done=false;
while ($done===false) {
$pstat=proc_get_status($proc);
if (!$pstat['running']) $done=true;
usleep(500000);
}
fclose($pipes[0]);
$rv=proc_close($proc);
echo('rv: '.$rv.PHP_EOL);
exit(0);
--- end code ---
Why oh why?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 349 |
Nodes: | 16 (0 / 16) |
Uptime: | 149:55:33 |
Calls: | 7,615 |
Calls today: | 3 |
Files: | 12,792 |
Messages: | 5,685,303 |
Posted today: | 2 |