bind '#|' dir dir/data dir/data1
bind '#|' dirEach binding allocates a fresh pipe.
The maximum message size is 128*1024 bytes . Writes of larger amounts will be partitioned into messages of that size (plus any residual).
Multiple concurrent writers are guaranteed that their data will be written atomically as long as each write is less than the maximum message size. Large writes will be partitioned into multiple messages and those may be interleaved with the data from other writers.
Writers to pipe interfaces on remotely mounted portions of the namespace have their guarantee of atomicity lowered to that of the Styx protocol, 8*1024 bytes (Sys->ATOMICIO).
A write of zero bytes into a pipe will result in a zero-length message that will become part of the data sequence delivered to readers. A zero-length message is interpreted by readers as an EOF condition.
Reads are destructive. Once read, the pipe cannot be re-read to obtain the same data.
Random access is not allowed. The current position in these files is ignored. Operations by sys->seek have no effect.
The following example illustrates that the cat command does not receive an EOF the first time around, because there is not a writer at the other end of the pipe. When more data is written to the pipe, the cat command receives an EOF and exits after writing the pipe data to standard output.
$ bind '#|' /tmp $ cd /tmp $ echo more > data $ echo more > data $ echo more > data $ cat data1& $ more more more $ ps 1 1 evb release 1K Sh[$Sys] 72 71 evb release 2K Cat[$Sys] 73 1 evb ready 2K Ps[$Sys] $ echo still more > data still more $ ps 1 1 evb release 1K Sh[$Sys] 75 1 evb ready 2K Ps[$Sys]Writes to a closed pipe generate an exception with the message:
write on closed pipeContinued attempts to read a closed pipe will result in an error.
The length member of the returned Dir adt represents the total byte count to be read on that interface. Thus, a write to one interface increases the length of the other.
The Dir adt also includes permissions for the interface. These permissions are not enforced by the pipe device.
As long as it remains mounted, a pipe may be opened and used repeatedly for inter-process communcation. When all the FDs acquired from open calls have been closed again, the pipe returns to its original state, ready to be opened again.