[phobos] Major improvements to std.process

Lars Tandle Kyllingstad lars at kyllingen.net
Thu Mar 11 03:33:29 PST 2010


I have just redone the interface of my std.process proposal, and I am 
very pleased with the result.

Calling "ls -l" is now as simple as writing

    spawnProcess("ls -l");

while "ls -l | grep foobar > filesNamedFoobar.txt" isn't that big of a 
deal either:

     auto pipe = Pipe.create();
     auto file = File("filesNamedFoobar.txt", "w");

     auto lsPid = spawnProcess("ls -l", stdin, pipe.writeEnd);
     scope(exit) lsPid.wait();

     auto grPid = spawnProcess("grep foobar", pipe.readEnd, file);
     scope(exit) grPid.wait();

The documentation is also a lot better now (though the spawnProcess() 
signature looks horrible, but that's a DDoc issue).  As always, please 
check out

     http://github.com/kyllingstad/ltk/blob/master/ltk/process.d
     http://kyllingen.net/code/ltk/doc/process.html

and give me your opinions.

-Lars


-- 
Lars Tandle Kyllingstad
@: lars at kyllingen.net
#: 40233221
w: http://www.kyllingen.net


More information about the phobos mailing list