io - acfr/comma GitHub Wiki

utilities

  • io-bandwidth: pass stdin to stdout and echo bandwidth to stderr
  • io-cat: concatenate or merge to stdout multiple input streams: tcp, pipes, files, etc
  • io-line: a line based stream tool to make reading lines from pipes non-destructive
  • io-ls: a quick parser for /proc/net/tcp; much faster than lsof, which may be very slow; linux only
  • io-publish: publish an input stream to multiple streams: tcp, pipes, files, etc
  • io-tee: fork data stream from stdin to an arbitrary pipeline with the deterministic termination
  • udp-client: a trivial udp receiver, since netcat and socat don't seem to handle udp very well; deprecated, use io-cat
  • zero-cat: a simple wrapper for a few widely used zmq stream patterns

io-line

First annotate the stream with line sizes using io-line length. Then use the io-line tool to get individual lines from the pipe. Tools like head will read the pipe using a buffer and will take more characters from the pipe then required. Other tools like bash read will take one character at a time and so can be quite slow.

processor | io-line length | { io-line get ; echo @ ; io-line get ; }

The io-line length and get combination has proven to be 10 times faster in one particular test with single lines that contained the encoded content of an otherwise wise quite large CSV file.

⚠️ **GitHub.com Fallback** ⚠️