Skip to content
Advertisement

Tag: pipe

pass stdout as file name for command line util?

I’m working with a command line utility that requires passing the name of a file to write output to, e.g. The only thing it writes to stdout is a message that indicates that it ran successfully. I’d like to be able to pipe everything that is written to output.txt to another command line utility. My motivation is that output.txt will

How to send integer with pipe between two processes!

I am trying to send an integer with pipe in a POSIX system but write() function is working for sending string or character data. Is there any way to send integer with a pipe? Regards Answer The safe way is to use snprintf and strtol. But if you know both processes were created using the same version of compiler (for

Non-blocking pipe using popen?

I’d like to open a pipe using popen() and have non-blocking ‘read’ access to it. How can I achieve this? (The examples I found were all blocking/synchronous) Answer Setup like this: Now you can read: When you’re done, cleanup:

Advertisement