Re: PHP exec function.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, June 10, 2005 3:04 am, Bob Snowdon said:
> ....
> $execstring="winposd.exe \"${physical}-${logical}-${parameter}\"";
> $output=exec($execstring);
> ....

exec only returns the FIRST LINE of output -- perhaps winposd (whatever
that is) prints a blank line first?

For that matter, winposd might output to standard error...

Does Windows have that???

If it does, how do you redirect?...

It *MIGHT* be the same as some shells in Linux:

$execstring="winposd.exe \"${physical}-${logical}-${parameter}\" 2&>1";

Or, it might not...

At any rate, USE the extra arguments to exec to get, like, *ALL* the
output, *PLUS* a super special bonus ERROR CODE returned from the
Operating System.

exec($execstring, $output, $error);
if ($error){
  echo "OS Error: $error\n";
  echo implode("\n", $output);
  exit;
}
echo implode("\n", $output);

To bastardize a quote:

If you ignore the errors of the present, you won't even have the
opportunity to repeat them. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux