Thread: A non-modal call similar to system()

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    144

    A non-modal call similar to system()

    Hi. system() is provided by stdlib.h as a mechanism to run a system command. This call waits for the invoked command to finish before passing the result back to the invoking program. Is there a call similar to system() that does not wait for the command to finish?

    Richard

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    If you are on a Windows box... #include <windows.h> and call ShellExecute()

    Don't know what it would be for Linux...

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    I don't know if there's any better option, but in Linux, you could fork a child process, then call one of the exec functions. It's equivalent in terms of parent/child relationship and simultaneous execution. Not sure what other differences there may be in environment, real and effective IDs, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recursive function
    By WatchTower in forum C Programming
    Replies: 11
    Last Post: 07-15-2009, 07:42 AM
  2. How to get RSSI value, send to sensor, sensor receive package, repackage it?
    By techissue2008 in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-04-2009, 10:13 AM
  3. What system call use the CreateThread Function of borland?
    By amfm0777 in forum Windows Programming
    Replies: 2
    Last Post: 06-20-2007, 05:41 AM
  4. Multiple types in lists, vectors or arrays.
    By megatron09 in forum C++ Programming
    Replies: 20
    Last Post: 08-31-2006, 01:54 PM
  5. Pls help me to do this project in C I need source code
    By sureshmenon74 in forum C Programming
    Replies: 4
    Last Post: 10-04-2001, 06:57 AM

Tags for this Thread