I want to detect when/if an application issues
read(stdin, ...). Is it possible to use unbuffered I/O so that I could wait on write in external process?
Some commands require user input when executed, I want to detect those and handle them because I'm targeting headless environment.
I'm also thinking whether the task isn't too broad and that the usage of
read(stdin, ..) is simply too generic and not limited to requesting user input, what other set of constraints would also apply? I can think of:
Perform these checks only if the
stdinhasn't been redirected to allow for
Prompts are usually reading entire lines (have to press enter), so maybe try write a single char
Or is the input discarded without blocking if the application is not
read(stdin, ...) at the moment the input is sent (that's just my rationale for
y\n in the terminal)?