You are here: Re: [PHP] PHP exec function. « PHP « IT news, forums, messages
Re: [PHP] PHP exec function.

Posted by "Richard Lynch" on 09/28/65 11:18

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация