I am not able to execute a binary via execlp.
chdir("/home/foo/bar/baz/MB/"); execlp("bash", "bash", "./foobarbaz 1", NULL); foobarbaz is my c file and I get the following error:
./foobarbaz: cannot execute binary file I tried doing chmod +x foobarbaz.c
and also test.c the file in which execlp is present.
What is the mistake I am making?
.ccd /home/foo/bar/baz/MB/and./foobarbaz 1?