diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-12-23 21:40:46 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-12-23 21:40:46 +0100 |
commit | c8a692cf39979962c72e8d3ec9108b85105feeb0 (patch) | |
tree | 7bee3cf35e72bffcf0112573964c6057568b2925 /fiforead.cpp | |
parent | 864bce4ebdc625468969891b36784490448ceea3 (diff) |
Diffstat (limited to 'fiforead.cpp')
-rw-r--r-- | fiforead.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fiforead.cpp b/fiforead.cpp new file mode 100644 index 0000000..6da0ae1 --- /dev/null +++ b/fiforead.cpp @@ -0,0 +1,16 @@ +#include <iostream> +#include <fstream> +#include <cassert> + +using namespace std; + +int main(int argc,char **argv){ + if(argc!=2){ + cerr<<"Pass fifo name as argument."<<endl; + return 1; + } + ifstream fifo(argv[1]); + assert(fifo.good()); + while(!!fifo)cout<<(char)fifo.get()<<flush; + return 0; +} |