I am trying to run an executable file within a c++ code. It compiles and run, but it displays a message "permission denied". This same code works on windows, I just use the appropriate file path.
Here is the code I am using
FILE *fp = popen("/home/Int_Outputs/bin/Debug","r"); if (fp == NULL){ std::cout <<"Popen is null" << std::endl; } char buff[50]; fgets(buff,sizeof(buff),fp); std::cout << buff; } return 0; }
cd /home/Int_Outputs/binand thensudo chmod u+r Debug. If that changes nothing, explain what exactly does not work.