diff --git a/example/child.cpp b/example/child.cpp index df4ad02..7efa7ba 100644 --- a/example/child.cpp +++ b/example/child.cpp @@ -9,8 +9,9 @@ void entry(QBiIPC& ipc) { ipc.send("Hello world!"); ipc.send_raw(size_t(1234567890)); - ipc.send("Trying to open file: /etc/passwd"); - std::ifstream f("/etc/passwd"); + auto fname = ipc.recv(); + ipc.send("Trying to open file: "+fname); + std::ifstream f(fname); if (f.fail()) { ipc.send(std::string("Failed: ")+strerror(errno)); } else { diff --git a/example/main.cpp b/example/main.cpp index cae6fca..bdc11d1 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -13,6 +13,7 @@ int main() { std::cout << ipc.recv() << std::endl << ipc.recv_raw() << std::endl; + ipc.send("/etc/passwd"); for (std::string line = ""; line != "End."; line = ipc.recv()) { if (!line.empty()) { std::cout << line << std::endl;