|
Posted by C. on 01/24/08 13:45
On 22 Jan, 11:55, "Jean Pierre Daviau" <O...@WasEno.ugh> wrote:
> Hi everyone,
>
> I am trying to capture the output from an exe that takes a file
> and output the counted words.
> ex:
> Usage: krx60410 < file
> Total Words : 103
> 8 de
> 7 la
> 4 culture
> 4 qui
> -------- snip ------------
>
> I tried the folowing wich doe not work has you gessed.
>
> $input = file($fichier);
> $output = exec("tree_words.exe < $input", fgets(STDOUT));
> echo $output;
>
I/O redirection expects a file - so unless $fichier is the name of a
file containing another filename you're doing something whacky here
which will not work. Surely you mean to do this:
$output = exec("tree_words.exe < $fichier", $real_output);
I have no idea what you're trying to do with fgets(STDOUT) which
doesn't even make sense on its own in PHP (the std streams exist but
have to be explicitly opened - there is no guarantee that the resource
will have a specific value therefore cannot be referenced using a
constant.
C.
Navigation:
[Reply to this message]
|