The OpenD Programming Language

ExternalProcess

UNSTABLE, NOT FULLY IMPLEMENTED. DO NOT USE YET.

You might use this like:

auto proc = new ExternalProcess();
auto stdoutStream = new ReadableStream();

// to use a stream you can make one and have a task consume it
runTask({
	while(!stdoutStream.isClosed) {
		auto line = stdoutStream.get!string(e => e == '\n');
	}
});

// then make the process feed into the stream
proc.onStdoutAvailable = (got) {
	stdoutStream.feedData(got); // send it to the stream for processing
	stdout.rawWrite(got); // forward it through to our own thing
	// could also append it to a buffer to return it on complete
};
proc.start();

Please note that this does not currently and I have no plans as of this writing to add support for any kind of direct file descriptor passing. It always pipes them back to the parent for processing. If you don't want this, call the lower level functions yourself; the reason this class is here is to aid integration in the arsd.core event loop. Of course, I might change my mind on this.

Constructors

this
this(FilePath program, string commandLine)

This is the native version for Windows.

this
this(FilePath program, string[] args)

This is the native version for Posix.

Members

Functions

isComplete
bool isComplete()
start
void start()
status
int status()
stderr
AsyncFile stderr()
stdin
AsyncFile stdin()
stdout
AsyncFile stdout()
waitForCompletion
void waitForCompletion()

Meta