I have an application making use of some packages. Looking at their source code I see they're doing a simple puts stderr ...
to dump out debug information. The problem is if you wrap the program with something like FreeWrap or the TDK, you lose access to the console; so we'd like to forward that stderr output to a file instead so we can see what's being printed.
I saw somewhere on StackOverflow that you can simply close the stderr
channel, open a new one, and it should automatically replace the most recently closed channel like so:
close stderr
set out [open "outfile.txt" w]
puts stderr "hello world" # should output to the file
Unfortunatly this doesn't work. When I try it I get the error message: can not find channel named "stderr"