Will the program deadlock if the error stream is not read regularly?

I initially wanted to quickly check the flow of errors from the program right after it starts working successfully.

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.RedirectStandardError = true;
string errortext = Process.StandardError.ReadToEnd();

      

However, I was wondering if I needed to redirect the process standard error back to the file.

I would think that if nothing is read from the std error and the program is writing many errors to the stream, then the buffer will eventually fill up. I don't know exactly how it works ProcessStartInfo.RedirectStandardError

, but my guess is that the buffer will not be automatically written to the file when it is full.

To avoid freezing the program I am reading, should I redirect to a file instead of stderror? and then just read that file in line to check for startup errors?

+3
c # stderr


source to share


No one has answered this question yet

Check out similar questions:

826
Creating a byte array from a stream
744
Reading settings from app.config or web.config in .net
685
How do I create a stream from a string?
1
stderr and stdout - not buffered or buffered?
0
Streaming a large file from an http service
0
Writing from stream to string
0
Catch errors on stdin, stdout, stderr
0
Error with the program that opens the file, reads the data and calculates the average
0
How to efficiently read from a pipe stream when using IPC C #
0
Reading from sys.stderr in python



All Articles
Loading...
X
Show
Funny
Dev
Pics