I have a c file I've compiled with a executable called "run" And want to run it with a argv[1] of testfile.txt that is in the uploads directory.
This here seems to work, but I don't understand why.
exec(__DIR__ . '/run uploads/testfile.txt',$output);
C programs are run as such:
./run uploads/testfile.txt
Adding a dot to the beginning of the exec() command makes it not work, but I'm running an executable, not a file (not a file run), why does the first example work but the other doesn't?
This doesn't work but it should?
exec(__DIR__ . './run uploads/testfile.txt',$output);
Where ./run is the c executable, and argv[1] is in the uploads directory which is testfile.txt