Null stream implementation


I’m looking for a Julia implementation of a stream (inheriting from IO) that acts like /dev/null (but usable for any OS).

It would just ignore anything that is streamed to it (ie it should redirect file IO to nowhere). Does such a thing exist in the Julia standard library? Or do I have to roll my own?

Kind regards

Is this what you are looking for?

help?> devnull
search: devnull


  Used in a stream redirect to discard all data written to it. Essentially
  equivalent to /dev/null on Unix or NUL on Windows. Usage:

  run(pipeline(`cat test.txt`, devnull))

Thanks @jw3126
I was looking in but couldn’t find it there

it’s in fact defined in

and doc is very explicit about it Essentials · The Julia Language

Sorry for noise!

1 Like