Thread: Execute an Independent Executable from a C program

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    1

    Question Execute an Independent Executable from a C program

    Hi,

    I want to start an executable file from my C program and so far I have used system("...") and execl("....",...) but the problem with these are: with system the main C program waits for the started process to finish and by execl the main C program terminates when the new process terminates.

    is there any other way to execute an independent process which works independent of my program?

    Thanks
    Last edited by diamond2004; 01-10-2012 at 01:14 AM. Reason: Clarify the question and Add more info

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    You can fork() before executing the other program...then just do the execution in the child process.
    If you understand what you're doing, you're not learning anything.

  3. #3

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 04-08-2009, 04:23 PM
  2. Execute another program
    By Revan-th in forum C++ Programming
    Replies: 4
    Last Post: 08-04-2006, 09:53 PM
  3. Can't execute another program
    By dwks in forum C Programming
    Replies: 7
    Last Post: 08-07-2005, 12:38 PM
  4. Starting independent exes from inside a c program
    By phil_drew in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 11:27 PM
  5. Cannot Execute a C++ Program
    By Vivekasundaram in forum C++ Programming
    Replies: 2
    Last Post: 10-03-2001, 01:53 AM

Tags for this Thread