Redirect stderr/out to IOBuffer()

Type ?write and you will find that it is documented.

Basically, you use write for writing raw binary data and print for writing textual representations. write(io, "foo") and print(io, "foo") do the same thing for most io objects, because "foo" is already text, but potentially the io object might change the text encoding if you are using print. See also this thread.

Edit: Oh, I see that you are referring specifically to the write(to::IO, from::IO) method. Yes, that is undocumented right now, but maybe we should document it? A PR would be a welcome place to discuss it.

1 Like