Pipes can, for example, be used for interprocess communication
by spawning a new process and passing one end of the pipe to
the child, while the parent uses the other end.
(See also pipeProcess and pipeShell for an easier
way of doing this.)
// Use cURL to download the dlang.org front page, pipe its// output to grep to extract a list of links to ZIP files,// and write the list to the file "D downloads.txt":autop = pipe();
autooutFile = File("D downloads.txt", "w");
autocpid = spawnProcess(["curl", "http://dlang.org/download.html"],
std.stdio.stdin, p.writeEnd);
scope(exit) wait(cpid);
autogpid = spawnProcess(["grep", "-o", `http://\S*\.zip`],
p.readEnd, outFile);
scope(exit) wait(gpid);
Creates a unidirectional pipe.
Data is written to one end of the pipe and read from the other.
Pipes can, for example, be used for interprocess communication by spawning a new process and passing one end of the pipe to the child, while the parent uses the other end. (See also pipeProcess and pipeShell for an easier way of doing this.)