diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-11-23 22:58:19 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-11-23 22:58:19 +0000 |
commit | cd215f0da23e16c3f1a7200f2b9f67f23c9b4be7 (patch) | |
tree | ef4b144cbc9a68110c1ea6a0b2eb73be2cbd02bb /src/tests | |
parent | b5b68088f28b2593bfbf910a46fd52775007e8b3 (diff) | |
download | libbu++-cd215f0da23e16c3f1a7200f2b9f67f23c9b4be7.tar.gz libbu++-cd215f0da23e16c3f1a7200f2b9f67f23c9b4be7.tar.bz2 libbu++-cd215f0da23e16c3f1a7200f2b9f67f23c9b4be7.tar.xz libbu++-cd215f0da23e16c3f1a7200f2b9f67f23c9b4be7.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/tests/procs.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ | |||
1 | #include "bu/process.h" | ||
2 | |||
3 | #include <stdio.h> | ||
4 | |||
5 | int main( int agrc, char *argv[] ) | ||
6 | { | ||
7 | Bu::Process p( argv[1], argv+1 ); | ||
8 | |||
9 | char buf[1000]; | ||
10 | for(;;) | ||
11 | { | ||
12 | int iSize = p.read( buf, 1000 ); | ||
13 | if( iSize == 0 ) | ||
14 | break; | ||
15 | fwrite( buf, iSize, 1, stdout ); | ||
16 | if( iSize < 1000 ) | ||
17 | break; | ||
18 | } | ||
19 | |||
20 | return 0; | ||
21 | } | ||
22 | |||