I'm looking for a way to detect whether or not a program has been called from pipe, e.g.
whatever | my_program
versus simply just being exectuated directly:
Why? In the first case, I want to run the program non-interactively, and in the latter case I want to print out user-friendly messages. I've been thinking along the lines of some check I haven't yet found, like:
if( stream_buffer_is_not_empty() )
Thanks to you!