ayat101 has asked for the wisdom of the Perl Monks concerning the following question:
I have the above C program with its arguments in the standard way. It is not really important what the program does, as I need to do this for several different programs.
The program expects a filename in place of $TRI, or a variable with a string in it which will be used as the filename. The output is then printed to a textfile with the filename.
I want to instead send the output to a pipe so I can read it without going through writing to and accessing a text file, so I speed up the processing as this gets repeated many thousands of times.
I can not append the program call with a pipe, because the results do not go there. I need to trick the C program into thinking a pipe handle is a textfile.
How do I do this? Perhaps I need to invoke the program in a different way? Is it even possible?
Considered by Tanktalus - code tags, please
Unconsidered by castaway - Keep/Edit/Delete: 4/33/0 - Looks fine to me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replace filename with pipe in program argument?
by Roy Johnson (Monsignor) on Mar 21, 2005 at 19:09 UTC | |
by Fletch (Bishop) on Mar 21, 2005 at 20:54 UTC | |
by ayat101 (Initiate) on Mar 22, 2005 at 02:18 UTC | |
by Roy Johnson (Monsignor) on Mar 22, 2005 at 02:51 UTC | |
|
Re: Replace filename with pipe in program argument?
by graff (Chancellor) on Mar 21, 2005 at 19:40 UTC | |
|
Re: Replace filename with pipe in program argument?
by insaniac (Friar) on Mar 21, 2005 at 18:51 UTC | |
|
Re: Replace filename with pipe in program argument?
by ayat101 (Initiate) on Mar 21, 2005 at 19:10 UTC | |
|
Re: Replace filename with pipe in program argument?
by perlfan (Parson) on Mar 21, 2005 at 20:15 UTC | |
|
Re: Replace filename with pipe in program argument?
by ayat101 (Initiate) on Mar 22, 2005 at 10:17 UTC |