I want to use Evolution mail client's message filter to pipe emails to my C++ program. I have written a C++ program and set up a filter in Evolution to pipe to my executable. Emails are filtered and my executable called, but when I try to read from stdin, nothing happens. I think my idea of using stdin is not correct. I have been reading around the internet about pipes, e.g. here, but am not sure if that is exactly what I need. Does anyone know if I'm on the right track, or can direct me in the right direction? E.g. do I need my C++ running all the time for Evolution, or does Evolution start and pipe to my executable.
Asked
Active
Viewed 171 times
0
-
1You can check pipe by command like this `echo some text | program` or `cat some.file | program`. – oklas Feb 07 '17 at 21:22
-
I tried that, but when I had my code running in the terminal waiting for input nothing came through. So I guess that means the pipe wasn't working. I'll see if I can use this as a tool to get my code right. Thanks for your helpful comment, it was definitely worth asking the question just for this, and might help others too. +1. – Feb 07 '17 at 21:28
-
Ok. I will create answer. I do such checkin for myself if need. I will be happy if this helpfully. – oklas Feb 07 '17 at 21:32
1 Answers
0
You can check pipe by command like this:
echo some text | program
or like this:
cat some.file | program

oklas
- 7,935
- 2
- 26
- 42
-
Thanks, in the end my code was correct except that I was outputting some things to `cout` which of course my code couldn't execute because there was no terminal to output to. Hence, the code was just hanging at that point and not executing the `cin` code from the pipe. I now have working code. As you say, echoing can be a big help for debugging. – Feb 07 '17 at 21:50