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:

  1. The test.exe file (made from my source code) icon shows a window icon (why, and this is the problem?)
  2. The problem is: Is that your desktop folder is ~ / on the desktop / . Tild means your home folder.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -