[racket] Duplicating output from a system call

From: Nick Shelley (nickmshelley at gmail.com)
Date: Thu May 16 16:12:51 EDT 2013

I have a script that runs some automated tests and logs the results to the
console. The tests can take 10+ minutes, so logging steps to the console is
informative. I'm using Racket to run the script with (system ...) and parse
the logs and report pass/failure, but to do that I have to capture the
logs. I spent about an hour in the port docs and can't figure out how to
both log to the console and capture the logs in Racket for further
processing (although I'm really good at missing the obvious).

My current workaround is to use the tee command when running the script and
then read in and process the file afterwords, but I was wondering if there
is a more direct way to do this in Racket.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130516/f372dd3d/attachment.html>

Posted on the users mailing list.