From 8d298e9353d9015cda43639cc6a77f43bc3c0f59 Mon Sep 17 00:00:00 2001 From: afederici <ajf5@illinois.edu> Date: Wed, 18 Nov 2020 20:56:52 -0600 Subject: [PATCH] bug fix --- src/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 33e7ad1..29334e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -166,10 +166,11 @@ int main(int argc, char *argv[]) cout << "USAGE: maple maple_exe num_maples sdfs_intermediate_dir sdfs_src_dir" << endl; continue; } - string testCommand = "./" + cmdLineInput[1] + " > /dev/null 2>&1"; - if (system(testCommand.c_str()) == -1) { - cout << "[MAPLE] " << cmdLineInput[1] << " does not exist locally, " << testCommand << " failed." << endl; - continue; + if (FILE *file = fopen(cmdLineInput[1].c_str(), "r")) { + fclose(file); + } else { + cout << "[MAPLE] " << cmdLineInput[1] << " does not exist locally" << endl; + continue; } if (!node->isBlackout){ string msg = cmdLineInput[1] + "," + cmdLineInput[2] + "," + cmdLineInput[3] + "," + cmdLineInput[4] + "\n"; -- GitLab