Hello,
How can i change the root directory to the current working directory.. I need to use some form of an exec call to run a program found in the current working directory but the problem is that the path of that program is required to start with '/'.... my code works fine if its just the name of the program:
if ( execv(path, arguments) == -1 ){
printf("Exec caused an error\n");
return EXIT_FAILURE;
}
I tried execl, execlp, and execvp, all end up with the same result:
"Directory or file cannot be found."
Any idea? Thanks!