i have a closed source program that prints output to standard output. i need to parse the output. so i redirect the output to a fifo (from which i can read in the parent process that forks and execs t
Ruby has constants and global variables for stdio. Namely, the consts STDIN, STDOUT, STDERR, and their variable counterparts, $stdin, $stdout, $stderr.
Calling fclose() here after dup()ing its file descriptor blocks until the child process has ended (presumably because the stream has ended).
I n开发者_开发问答eeded to forward stdout to different files to separate some prints produced and the reverting back to normal stdout.
Is there a libc function that would do the same thing as getline, but would work with a connected socket instead of a FILE * stream ?