I have an executable (compiled FORTRAN) that uses the terminal to request input for the user and the output goes to different files (e.g., out1.txt, out2.txt). I have created an R function that generates a response file for the executable. Then I can use my response file to get all my output. For example if I run from the command line
pm.exe < pm.resp I will get all my outputs (e.g., 1.txt, 2.txt, etc). Now I want to incorporate the whole procedure within R.
If I run from the R console
system2("pm.exe", wait = FALSE, invisible = FALSE, stdin = "pm.resp") I get my output with no problem. However If use that line within an R function then I don't get any output. I tried using
shell but no luck.