Hi I was writing a C program that performs interaction between the two other programs A and B. The interaction goes on as follows -
A reads from a file1 and writes to file2. Now B reads from file1 and writes to file2 and this goes on forever. Note that the programs B and C are simple programs i.e. they don't have any system statements that is why I am using the program C to change their standard input and output streams , but how to do it ? Due to race condition the STDIN is getting pointed to two different locations at a time. Could you please suggest a smarter way to do it. I know about pipes and fifo. It is similar to the interactive programming on online judges like codeforces.