Capturing another program's output into current C program...

From: Jerome (great_saiyaman__at_hotmail.com)
Date: 01/13/04


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



Relevant Pages

  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Kevin Backmann ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • Re: Displaying a large amount of data quickly (VB6)
    ... >>> involving a loop of VB code would be too slow. ... but I'd sure be interested to know if that StringBuilder ... Array elements: 25000 ... Array construction: 17 ...
    (microsoft.public.vb.controls)
  • Re: Problem with a script
    ... a loop there becomes impractical. ... You still have them as uniquely named array indexes... ... writing the code twice will only ... reading your entire code and parsing it in their head, ...
    (comp.lang.php)