calling programs

This is a discussion on calling programs within the C Programming forums, part of the General Programming Boards category; Hi there, how can I call an other program in the currently running program using the spawn ... family of ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    29

    calling programs

    Hi there,

    how can I call an other program in the currently running program using the spawn ... family of functions ?

    I've tried calling a program called checksum which takes three char* args like this:

    spawnl (P_WAIT, checksum arg1,arg2,arg3,NULL);


    arg1 and arg3 are both filenames;arg1 is a file present in the working directory and arg3 is a file to be created by checksum.
    arg2 is a simple char* switch.
    Checksum.exe also exists in the same directory.

    I can't get it to work ...

    Can you help ?

    Thanks,

    bigSteve

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,532
    Read the manual - spawnl args start at arg0, not arg1

    spawnl (P_WAIT, checksum, checksum,arg1,arg2,arg3,NULL);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Communication between programs?
    By johny145 in forum Windows Programming
    Replies: 3
    Last Post: 06-01-2005, 10:14 PM
  2. Problem using java programs within C code
    By lemania in forum Linux Programming
    Replies: 1
    Last Post: 05-08-2005, 02:02 AM
  3. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 02:35 AM
  4. POSIX/DOS programs?
    By nickname_changed in forum C++ Programming
    Replies: 1
    Last Post: 02-28-2003, 04:42 AM
  5. Altering The Program's Executable?
    By Aidman in forum C++ Programming
    Replies: 7
    Last Post: 12-31-2002, 04:11 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21