--- a/src/AwkHandler.h Sun May 05 01:08:24 2019 +0200
+++ b/src/AwkHandler.h Sun May 05 11:51:45 2019 +0200
@@ -132,16 +132,18 @@
} else if (writerPid == 0) {
// Writer child process
closeOrThrow(awkInputWriterFD);
- fwprintf(stderr, L"I am child Writer with PID: %d\n", getpid());
+ fwprintf(stderr, L"I am child Writer with PID: %d Writer: %p\n", getpid(), relationalWriter);
- __gnu_cxx::stdio_filebuf<char> awkOutputReaderBuffer(awkOutputReaderFD, std::ios::in);
- std::istream awkOutputReader(&awkOutputReaderBuffer);
+ __gnu_cxx::stdio_filebuf<wchar_t> awkOutputReaderBuffer(awkOutputReaderFD, std::ios::in);
+ std::wistream awkOutputReader(&awkOutputReaderBuffer);
- std::cout << "--- PIPE start --------" << std::endl;
- for (char ch = awkOutputReader.get(); awkOutputReader.good(); ch = awkOutputReader.get()) {
- std::cout << ch;
+ relationalWriter->startRelation(L"writer_debug",{
+ {L"message", writer::TypeId::STRING},
+ }, true);
+
+ for (wchar_t ch = awkOutputReader.get(); awkOutputReader.good(); ch = awkOutputReader.get()) {
+ relationalWriter->writeAttribute(string_t(1, ch));
}
- std::cout << "--- PIPE end ----------" << std::endl;
closeOrThrow(awkOutputReaderFD);
exit(0);
@@ -149,18 +151,6 @@
// Parent process
closeOrThrow(awkOutputReaderFD);
fwprintf(stderr, L"Forked Writer has PID: %d\n", writerPid);
-
- dprintf(awkInputWriterFD, "hello world :-)\n");
- //closeOrThrow(awkInputWriterFD);
-
- /*
- __gnu_cxx::stdio_filebuf<char> awkInputWriterBuffer(awkInputWriterFD, std::ios::out);
- std::ostream awkInputWriter(&awkInputWriterBuffer);
- awkInputWriter << "hello world :-)" << std::endl;
- awkInputWriter.flush();
- closeOrThrow(awkInputWriterFD);
- */
-
}
}