C: exec to my own exe file -
I am using linux for try and exec to run a different child process in the basic process.
The I Ps can execute the child process to run the command.
int x = fork (); If (x == 0) {execl ("/ bin / ps", "ps", NULL); } However, as soon as I try to run the .exe file which I have created from my C file in this way GCC-V test.c -o test. Exe . By running this code: int x = fork (); If (x == 0) {execl ("/ desktop / test", "test.exe", NULL); } Then nothing happens if I print the statement above execl then it gives -1. Will someone tell me what's going on?
Some notes:
- The test.exe file (made from my source code) icon shows a window icon (why, and this is the problem?)
-
-
-
The problem is: Is that your desktop folder is ~ / on the desktop / . Tild means your home folder.
Comments
Post a Comment