popen with args?

This is a discussion on popen with args? within the Linux Programming forums, part of the Platform Specific Boards category; how can a call a program with command line args? i checked out popen, but i havnt seen anything about ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    913

    popen with args?

    how can a call a program with command line args?

    i checked out popen, but i havnt seen anything about program arguements.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    You mean like:

    fp = popen ("ping 127.0.0.1", "r");
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    i was wondering if something like this was possible

    popen("ping %s", r, ip_string);

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    If you look at, and actually read, the man page, popen only takes 2 parameters.

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    If you look at, and actually read, the man page, popen only takes 2 parameters.
    brilliant!!!

    thats why i asked the question in the first place!!!



    im looking for a function/way to execute a program with arguements and be able to read its output. im not sure how to go about this.

    any ideas?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. popen and fgets, underflow!
    By henrikstolpe in forum Linux Programming
    Replies: 0
    Last Post: 02-06-2009, 02:39 AM
  2. popen takes too long?
    By Largo in forum C Programming
    Replies: 2
    Last Post: 11-20-2006, 05:46 AM
  3. popen()
    By Cactus_Hugger in forum Windows Programming
    Replies: 2
    Last Post: 10-22-2005, 03:16 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM

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