I have a bidirectional stream $stream
returned from ssh2_exec($command)
. The stream represents both the input and output of the command.
I can send input to the command with fwrite($stream)
and I can read the command's output with fread($stream)
.
I can check for the end of output with feof($stream)
, but I have no way to tell the command about the end of input.
If I call fclose($stream)
, the bidirectional stream is destroyed completely, and any following fread($stream)
fails.
How can I do something like fcloseinput($stream)
to close just the input part of the bidirectional stream?