Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi friend.
i have problem when using execlp function in c in linux OS.

i set the first parameter of it path of executable file and second parameter to name of file like this and else. what is wrong with this code that do not execute the program.

execl("home/davood/Desktop/a","./t2.exe","-la",NULL);

thanks friend.
Posted
Comments
[no name] 9-May-14 15:08pm    
http://linux.die.net/man/3/execlp
_Starbug_ 9-May-14 15:29pm    
still have problem when using it.
_Starbug_ 9-May-14 16:02pm    
still i have a problem in using it.

1 solution

Quote:
execl("home/davood/Desktop/a","./t2.exe","-la",NULL);

Probably you meant:

/home/davood/Desktop/a
 
Share this answer
 
Comments
_Starbug_ 9-May-14 16:52pm    
what this mean? please answer. i need it.
_Starbug_ 9-May-14 16:54pm    
i placed a / in there but this code do not execute my program.
_Starbug_ 9-May-14 16:57pm    
how you use execlp function to execute a new program. please place a simple complete code.
CPallini 10-May-14 6:24am    
Is 'a' a Linux executable (you know, by defult gcc produces 'a.out', and you have to full qualify it, that is have to launch 'a.out')?
_Starbug_ 10-May-14 13:01pm    
yes i solved this myself.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900