Re: How do I compose pipes?

2021-01-28 Thread Anthony via Digitalmars-d-learn
On Friday, 29 January 2021 at 03:49:38 UTC, Ali Çehreli wrote: On 1/28/21 3:45 PM, Anthony wrote: > void end(AccumulatorPipe acc) { > auto pids = acc.pids ~ P.spawnShell("cat", acc.stdout); > > foreach (pid; pids) { > P.wait(pid); > } > } > ``` > > > So now I can do

Re: How do I compose pipes?

2021-01-28 Thread Ali Çehreli via Digitalmars-d-learn
On 1/28/21 3:45 PM, Anthony wrote: > void end(AccumulatorPipe acc) { > auto pids = acc.pids ~ P.spawnShell("cat", acc.stdout); > > foreach (pid; pids) { > P.wait(pid); > } > } > ``` > > > So now I can do something like: > ``` > run("find source -name '*.d'") >

Re: How do I compose pipes?

2021-01-28 Thread Anthony via Digitalmars-d-learn
On Thursday, 28 January 2021 at 17:18:46 UTC, Ali Çehreli wrote: On 1/28/21 2:16 AM, Anthony wrote: > auto p = pipeProcess("ls"); > auto q = pipeProcess("cat", stdin = p.stdout); //it would be good to do That would work if `cat` received the *contents* of the files (and with a "-" command

Re: How do I compose pipes?

2021-01-28 Thread Ali Çehreli via Digitalmars-d-learn
On 1/28/21 2:16 AM, Anthony wrote: > auto p = pipeProcess("ls"); > auto q = pipeProcess("cat", stdin = p.stdout); //it would be good to do That would work if `cat` received the *contents* of the files (and with a "-" command line switch). Since `ls` produces file names, you would have to make