Capturing another program's output into current C program...
From: Jerome (great_saiyaman__at_hotmail.com)
Date: 01/13/04
- Next message: dbtid: "Re: Capturing another program's output into current C program..."
- Previous message: Thad Smith: "Re: custom header files"
- Next in thread: dbtid: "Re: Capturing another program's output into current C program..."
- Reply: dbtid: "Re: Capturing another program's output into current C program..."
- Reply: TLOlczyk: "Re: Capturing another program's output into current C program..."
- Reply: Michael B Allen: "Re: Capturing another program's output into current C program..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 13 Jan 2004 19:46:14 GMT
I am writing a C program that captures another program's output. The
main catch is, the secondary program is called in a loop (the loop goes
up to 10,000 iterations). The output is then stored in a large array.
Lastly, the data from the large array is computed to yield some
statistical information.
My initial attempt was to use pipe and a call to fork to handle output
redirection. This works fine for less than 10 iterations, and simply
does not work with anything over that. I am still an
novice->intermediate programmer and understand that a call to fork
should not be done in a loop. However, I don't know how else I can
approach this issue. I can easily write a perl program that can do the
above spec, but am convinced that a C program would run considerably
faster in this case than the perl could.
Any advice, info, and URL links would be greatly appreciated.
Thanks in advanced,
~Jerome
- Next message: dbtid: "Re: Capturing another program's output into current C program..."
- Previous message: Thad Smith: "Re: custom header files"
- Next in thread: dbtid: "Re: Capturing another program's output into current C program..."
- Reply: dbtid: "Re: Capturing another program's output into current C program..."
- Reply: TLOlczyk: "Re: Capturing another program's output into current C program..."
- Reply: Michael B Allen: "Re: Capturing another program's output into current C program..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|