-
execlp and File input
Hello,
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,
-
Like I showed you here
http://cboard.cprogramming.com/showt...ghlight=dup%2A
Only you open the file for reading and close(0)