non-block reading from pipe stdout

Oleg B code.viator at gmail.com
Tue Oct 3 00:22:28 UTC 2017


Hello. I run program through std.process.pipeShell and want to 
read from it stdout in loop. How do this non-blocking?

I try

	int fd = p.stdout.fileno;
	int flags = fcntl(fd, F_GETFL, 0);
	flags |= O_NONBLOCK;
	fcntl(fd, F_SETFL, flags);

but get error "Resource temporarily unavailable".


More information about the Digitalmars-d-learn mailing list