I'm trying to do a program which modifies source code from another program and then stops the program.
The basic idea is that when program "A" runs, it will compile and run program "B". When I put some text file with some format in an specific directory, program "A" will detect that and stops program "B", modify program "B" source code with whatever it finds in the text file, and then compile and run program "B" again.
The behavior will be pretty much alike of what an IDE does when we compile, run and stops programs when we are coding, but it can't be done by the user, it has to be automatic. I have find some examples on how to compile and run, but not on how to stop.