View Full Version : System call doubt

December 14th, 2008, 09:40 AM
Hello eveyone ,

I'm new to linux programming and wanted to know the system call that I can use for opening any application in Ubuntu.

Any help and guidance would be appreciated.

Thaank You.

December 14th, 2008, 03:44 PM
You can use system() function to execute any program. Therefore, if you want to run the ls command from a C program, you can do so by doing system("ls") in your C program. Header file used will be stdio.h.

Hope this helped. :-)

December 14th, 2008, 07:24 PM
If you mean you want to execute some command line, then the method will vary by language. kcode's answer applies to C. Python programs have several methods with their benefits and drawbacks.

If you want to open an arbitrary item like double-clicking its icon does, call xdg-open.