From cd215f0da23e16c3f1a7200f2b9f67f23c9b4be7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 23 Nov 2007 22:58:19 +0000 Subject: Added the Process stream class, this will allow us to do some really cool stuff coming up...it's just like popen only cool and managed, and streamey. --- src/tests/procs.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/tests/procs.cpp (limited to 'src/tests') diff --git a/src/tests/procs.cpp b/src/tests/procs.cpp new file mode 100644 index 0000000..53e5142 --- /dev/null +++ b/src/tests/procs.cpp @@ -0,0 +1,22 @@ +#include "bu/process.h" + +#include + +int main( int agrc, char *argv[] ) +{ + Bu::Process p( argv[1], argv+1 ); + + char buf[1000]; + for(;;) + { + int iSize = p.read( buf, 1000 ); + if( iSize == 0 ) + break; + fwrite( buf, iSize, 1, stdout ); + if( iSize < 1000 ) + break; + } + + return 0; +} + -- cgit v1.2.3