What is the best way to capture output?
by lucmove from LinuxQuestions.org on (#6NEXF)
I have an application generating output at a high rate. Milliseconds. The output is appended to a file in /dev/shm so it's fast enough and won't tax the SSD.
Now, I need to capture that output with another application which I will write in a scripting language. It basically "slurps" the output file at very short (milliseconds) intervals.
I've given up on this idea before, I want to try again. I remember there were a number of pitfalls, mainly around the problem of "skipping beats."
The last time, I tried it with mkfifo but I didn't have a good experience. It was awkward because the capture wouldn't really begin until I opened the receiving end of the fifo with tail and I wish I could avoid that. I think the flow also got interrupted after some time as if it was exhausted or broken or something.
In the Windows 9x era, that would be done with COM or DDE I guess. What about Linux? What other approaches can you suggest? Networking? Sockets? Something else?
Now, I need to capture that output with another application which I will write in a scripting language. It basically "slurps" the output file at very short (milliseconds) intervals.
I've given up on this idea before, I want to try again. I remember there were a number of pitfalls, mainly around the problem of "skipping beats."
The last time, I tried it with mkfifo but I didn't have a good experience. It was awkward because the capture wouldn't really begin until I opened the receiving end of the fifo with tail and I wish I could avoid that. I think the flow also got interrupted after some time as if it was exhausted or broken or something.
In the Windows 9x era, that would be done with COM or DDE I guess. What about Linux? What other approaches can you suggest? Networking? Sockets? Something else?