Add support for redirecting STDOUT/STDERR to a file.