initial commit
This commit is contained in:
commit
9830cf3047
5 changed files with 227 additions and 0 deletions
21
pcat.cpp
Normal file
21
pcat.cpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
while(true) {
|
||||
|
||||
// Blocking call on named pipes.
|
||||
std::ifstream ifs(argv[1]);
|
||||
std::stringstream datas;
|
||||
datas << ifs.rdbuf();
|
||||
ifs.close();
|
||||
|
||||
std::string data = datas.str();
|
||||
|
||||
std::cout << datas.str();
|
||||
std::cout.flush();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue