aboutsummaryrefslogtreecommitdiff
path: root/fiforead.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fiforead.cpp')
-rw-r--r--fiforead.cpp16
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;
+}