P
palaga
Hi
I'm starting an external process that writes data to stdout, and I want to
get back these data.
So I use myProcess.StandardOutput (everything is correctly set, I can read
the data).
to read data, I use myProcess.StandardOutput.ReadLine( ). (the data is
text). The doc says that if there is no more data available, the function
ReadLine return null.
This does not seem to work with the standard output stream of a process...
If there is no data available, the ReadLine blocks, and returns only when it
gets data, or the process ends.
So I tried to use Peek() to see if there are data, before calling
readline... no way, stdout is not seek-able, so peek() always return -1.
I also tried to use Read(), and it doe snot work as well...
How can I know if there are data available in my process standard output
stream ?
I'm starting an external process that writes data to stdout, and I want to
get back these data.
So I use myProcess.StandardOutput (everything is correctly set, I can read
the data).
to read data, I use myProcess.StandardOutput.ReadLine( ). (the data is
text). The doc says that if there is no more data available, the function
ReadLine return null.
This does not seem to work with the standard output stream of a process...
If there is no data available, the ReadLine blocks, and returns only when it
gets data, or the process ends.
So I tried to use Peek() to see if there are data, before calling
readline... no way, stdout is not seek-able, so peek() always return -1.
I also tried to use Read(), and it doe snot work as well...
How can I know if there are data available in my process standard output
stream ?