Thread: execlp and File input

  1. #1
    Registered User
    Join Date
    Apr 2003

    execlp and File input


    I'm trying to run a program via execlp and then fill it's input from another file.

    Ideally it is going to mimic file<input. I've been playing with fgets and fgetc but I can't figure out how to get the information into the file being executed. I think I would turn off the stdin for the file being executed and then send the information to it but I don't know how.

    Any suggestions....

    Thank you,

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Like I showed you here

    Only you open the file for reading and close(0)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. execlp output to file
    By Schwarzhelm in forum C Programming
    Replies: 1
    Last Post: 11-04-2003, 01:24 AM
  2. Using execlp
    By mmondok in forum C Programming
    Replies: 0
    Last Post: 04-19-2003, 10:15 PM