I'm calling an .exe
from R using system("script.exe object")
.
I get Warning: running command had status 127
. I know it means the .exe
file has not been found.
I'm on windows. When I use shell
instead of system
it works like a charm. However, I am designing a Shiny application that will be deployed in a Linux environment (shinyapps.io). This is why I need to use system
.
EDIT
On Windows, it works with system(paste("cmd.exe /c", "script.exe object"), intern = FALSE, wait = TRUE)
as suggested here. But not when I deploy the app (on Linux).
HINT
Locally on Windows, if I replace system
with system2
: system2(paste("cmd.exe /c", "script.exe object"), wait = TRUE)
, it raises the status 127
warning and the output is exactly the same as in my deployed app on Linux.
It's tough to create a reproducible example here but if needed I can try. Please tell me.
Context: basically the .exe
is a black box (compiled C++ code) that takes a .txt file as input and outputs another .txt file. I am using R to dump the .txt file to the current working directory, then read back in the .txt file generated by the .exe
(created in the current working directory, where the .exe
file is stored).