On Friday, May 23, 2014 5:36:40 PM UTC-4, Andrea Pagnani wrote:

> I'm struggling to understand writesto.
>

I have a patch pending to make this a lot easier, so that it looks like 
writing to an ordinary file with "open": 
https://github.com/JuliaLang/julia/pull/6948
 

> I wonder if it would be possible to intercept the STDOUT of a function, e.g
>

Technically yes, it is possible: you use the redirect_stdout() 
function<http://docs.julialang.org/en/latest/stdlib/base/?highlight=redirect_stdout#Base.redirect_stdout>.
   
This will even capture STDOUT from external C programs etcetera .... it is 
how IJulia captures standard output and sends it to the browser.

However, most native Julia I/O functions will accept an IO argument so that 
you can send their output to something other than STDOUT without resorting 
to redirection tricks.

Reply via email to