Re: Exec() hangs if 4k written to StdErr, even with StdErr.ReadAll()

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




The best way I found to avoid blocking is to redirect StdOut or StdErr
to a file, or if you don't need them separate then you can redirect
StdErr to StdOut using the POSIX standard 2>&1 (redirect handle 2,
stderr, to the address of handle 1, stdout), e.g.
dir /b 2>&1



--
kmashint
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

.



Relevant Pages

  • Re: redirect the output to a file
    ... you have two commands executed in sequence. ... That will cause all output from /make/ to stdout to be sent to ... error messages sent to stderr will only go to the screen. ... Will first redirect stderr to stdout, then send it all to /tee/. ...
    (comp.os.linux.misc)
  • redirecting messgaef from sys.stdout
    ... I?m trying to run an external program in my ... program and redirect its stdout and stderr to the main ...
    (comp.lang.python)
  • nohup cmd 2>&1 >> logfile does not work in the crontab
    ... if you start a command from the crontab then stderr is ... not redirected to stdout. ... Only if I wrap the nohup command in a script and redirect de stdout ...
    (comp.unix.aix)
  • Re: redirecting messgaef from sys.stdout
    ... Its responsibility is to run the external program and redirect its stdout and stderr to the main application. ... the stdout and stderr will be redirected o command prompt. ...
    (comp.lang.python)
  • Re: capturing stderr from windows
    ... >>I wrote a perl script which invokes system calls using system. ... >>I want to be able to redirect the output of these calls to a file. ... > I get both STDOUT and STDERR messages in results.log. ...
    (comp.lang.perl.misc)