I’m ccalling a function in a shared lib which writes something to stdout (i.e. it appears it the terminal). Is it possible to capture this text output? Among other things, I tried
mktemp() do path, io
redirect_stdout(io) do
println("test1")
ccall(...)
println("test2")
end
flush(io)
s = read(path, String)
end
but this only produces s == "test1\ntest2\n" .
Any ideas how to capture the stdout output triggered by the ccall as well?
Thanks in advance!