[D Cookbook]about "Communicating with external processes" part.

xky via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 13 07:45:59 PDT 2015


On Sunday, 13 September 2015 at 13:44:06 UTC, anonymous wrote:
> On Sunday 13 September 2015 15:32, xky wrote:
>
>> [ pipe.d ]:
>> ======================================================================
>> import std.process;
>> import std.stdio;
>> 
>> void main(){
>> 	auto info = pipeProcess("child.exe");
>> 	scope(exit) wait(info.pid);
>> 
>> 	info.stdin.writeln("data to send to the process");
>> 	info.stdin.close();
>> 
>> 	foreach(line; stdout.byLine){
>
> I think it should be `info.stdout.byLine` here.
>
>> 		writeln("Received ", line, " from child.");
>> 	}
>> }
>> ======================================================================

Yes, thanks for the tip detail!


More information about the Digitalmars-d-learn mailing list