magicpipe — pipe data through a shared memory buffer
magicpipe [
[ -i | --input ]
|
[ -o | --output ]
] [OPTIONS] id_file
When used as an input, magicpipe reads its standard input and copies that data to a shared memory region. As an output, magicpipe reads data from the shared memory region, and copies it to standard output.
magicpipe's behavior is simple, but can be used effectively. Multiple commands can be sequentially piped into magicpipe inputs, with each program's output being appended to the resulting magicpipe output. Consequently, the output from all of those programs is merged into a single data stream, with only one end-of-file (that occurs when the magicpipe output terminates).
id_file must be given on the command line. A magicpipe output will create this file if it does not exist, and write the shared memory IPC ID to it. A magicpipe input pointed at the same file reads this ID. The id_file is the only way that a magicpipe input knows which shared memory region to write to, so it is an essential parameter.
Mandatory arguments to long options are mandatory for short options too.
-b,
--bytes=bytes
Number of bytes to transfer at one time. (defaults to 512, maximum is 10485760 — 10MB) Muliplier of k or m may be used.
-m,
--minbytes=bytes
Data is transferred in chunks of minbytes at a time (may cause truncation of data). Muliplier of k or m may be used.
-s, --stdout
Causes magicpipe inputs to copy data on stdin to both stdout and
shared memory. No effect when used with --output
(-o).
-v, --versionPrint version info to standard output.
-h, --helpPrint this text to standard output.
Multipliers: k = 1024; m = 1048576