A
Arvin Portlock
I've written a perl cgi script but it's too slow so I need
to rewrite it in C++. The perl script passes parameters to
a search engine on our local filesystem and processes the
results (number of hits, etc.). I've never had to do anything
like this in C++ before and I don't know where to start.
So what is the equivalent in C++ to something like this?
open (RESULTS, "srch -q $word |");
Which is the perl method of opening a handle on the output
of a pipe. I imagine I'd like to use system() but there doesn't
seem to be a way to capture the output of the call. Reading
through similar messages in this group I get the impression
this really can't be done. It seems like I need to pass the
search results to the program through the operating system
(the results are VERY large), i.e., through STDIN. This would
be less convenient since I'd like to package everything up
in one program.
Is this true? Is there not a way to do this?
to rewrite it in C++. The perl script passes parameters to
a search engine on our local filesystem and processes the
results (number of hits, etc.). I've never had to do anything
like this in C++ before and I don't know where to start.
So what is the equivalent in C++ to something like this?
open (RESULTS, "srch -q $word |");
Which is the perl method of opening a handle on the output
of a pipe. I imagine I'd like to use system() but there doesn't
seem to be a way to capture the output of the call. Reading
through similar messages in this group I get the impression
this really can't be done. It seems like I need to pass the
search results to the program through the operating system
(the results are VERY large), i.e., through STDIN. This would
be less convenient since I'd like to package everything up
in one program.
Is this true? Is there not a way to do this?