The way we can redirect the output is by closing the current file descriptor and then reopening it, pointing to the new output. We'll do this using the open and dup2 functions. There are two default outputs in Unix systems, stdout and stderr. stdout is associated with file descriptor 1 and stderr to 2.
I am going to execute a Process (lame.exe) to encode a WAV file to MP3.
I want to process the STDOUT and STDERR of the process to display progress information.
Do I need to use threading? I can't get my head around it.
Some simple example code would be appreciated.
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With