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

xky via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 13 06:32:23 PDT 2015


Hello. :)
I just got a this problem when i read "D Cookbook".



[ 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){
		writeln("Received ", line, " from child.");
	}
}
======================================================================



[ child.d ]:
======================================================================
import std.stdio;
void main(){
	writeln("hello");
}
======================================================================



[ CMD ]:
======================================================================
C:\Users\user\Desktop\pipe>pipe.exe
std.stdio.StdioException at std\stdio.d(3867
----------------
0x00407BEF
0x00403149
0x004029F0
0x0040289B
0x0040307F
0x00403032
0x0040300E
0x00402FC1
0x0040272F
0x004026DB
0x004020E2
0x00406412
0x004063E7
0x004062FB
0x00403E7F
0x7493336A in BaseThreadInitThunk
0x76EF9882 in RtlInitializeExceptionChain
0x76EF9855 in RtlInitializeExceptionChain
Failed to flush stdout: No error
======================================================================



Well... That's all! It's my mistake? How can i slove this 
problem? :/

regards,


More information about the Digitalmars-d-learn mailing list